Part Number Hot Search : 
ER801F T211029 DTC144E PL002 C107M Z27VC DR2AR SA103
Product Description
Full Text Search
 

To Download ST6208C Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  rev. 3.0 june 2000 1/105 ST6208C/st6209c st6210c/st6220c 8-bit mcus with a/d converter, two timers, oscillator safeguard & safe reset n memories 1k, 2k or 4k bytes program memory (otp, eprom, fastrom or rom) with read-out protection 64 bytes ram n clock, reset and supply management enhanced reset system low voltage detector (lvd) for safe reset clock sources: crystal/ceramic resonator or rc network, external clock, backup oscillator (lfao) oscillator safeguard (osg) 2 power saving modes: wait and stop n interrupt management 4 interrupt vectors plus nmi and reset 12 external interrupt lines (on 2 vectors) n 12 i/o ports 12 multifunctional bidirectional i/o lines 8 alternate function lines 4 high sink outputs (20ma) n 2 timers configurable watchdog timer 8-bit timer/counter with a 7-bit prescaler n 1 analog peripheral 8-bit adc with 8 input channels (except on ST6208C) n instruction set 8-bit data manipulation 40 basic instructions 9 addressing modes bit manipulation n development tools full hardware/software development package device summary (see section 12.5 for ordering information) pdip20 so20 cdip20w ssop20 features st62t08c(otp)/ ST6208C(rom) st62p08c(fastrom) st62t09c(otp)/ st6209c (rom) st62p09c(fastrom) st62t10c(otp)/ st6210c (rom) st62p10c(fastrom) st62t20c(otp) st6220c(rom) st62p20c(fastrom) st62e20c(eprom) program memory - bytes 1k 2k 4k ram - bytes 64 operating supply 3.0v to 6v analog inputs - 48 clock frequency 8mhz max operating temperature -40 c to +125 c packages pdip20/so20/ssop20 pdip20/so20 cdip20w 1
table of contents 105 2/105 2 1 introduction . . . . . . . . . . . . . . . . . . . . . ......................................... 6 2 pin description . . . . . . . . . . . . ........................................... ..... 7 3 memory maps, programming modes and option bytes . . . . . . . . . . . . . . . . . . . . . . 9 3.1 memory and register maps . ......................................... 9 3.1.1 introduction . . . ..................................................... 9 3.1.2 program space . . . . . . . . . . . . . . . . . . . . ................................ 11 3.1.3 readout protection . . . . . . ........................................... 11 3.1.4 data space . . . . . . . . . . . . . . . . . . . . . . . . . .............................. 11 3.1.5 stack space . . . . . . . . . . . . ........................................... 11 3.1.6 data rom window . . ............................................... 13 3.2 programming modes . ............................................... 15 3.2.1 program memory . . . ................................................ 15 3.2.2 eprom erasing .................................................... 15 3.3 option bytes . . . ................................. ................... 16 4 central processing unit . . ............................................... 17 4.1 introduction . ...................................................... 17 4.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................... 17 4.3 cpu registers . . . . . . . . . . . . . . . . . . . . . ................................. 17 5 clocks, supply and reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.1 clock system . ...................................................... 19 5.1.1 main oscillator . . . . . . . . . . . . . . . . . . . . ................................. 20 5.1.2 oscillator safeguard (osg) . . . ........................................ 21 5.1.3 low frequency auxiliary oscillator (lfao) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.1.4 register description . . . . . . ........................................... 22 5.2 low voltage detector (lvd) . . . . . . . . ................................ 23 5.3 reset . . . . . . . . . . . . . . . . . . . . . . . ........................................ 24 5.3.1 introduction . . . .................................................... 24 5.3.2 reset sequence . . . ............................................... 24 5.3.3 reset pin . . . . . . . . . ............................................... 25 5.3.4 watchdog reset . . . . . . . . . . . . . . . . . . ................................. 26 5.3.5 lvd reset . . . . . . . . . ........................................... .... 26 6 interrupts . . ......................... .................................... 27 6.1 interrupt rules and priority management . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.2 interrupts and low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.3 non maskable interrupt . . . . . . . . . . .................................. 28 6.4 peripheral interrupts . . ........................................... 28 6.5 external interrupts (i/o ports) . . . ............................. .... 29 6.5.1 notes on using external interrupts . . . . . . . . .............................. 29 6.6 interrupt handling procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........ 30 6.6.1 interrupt response time . . . . . . . . . . . .................................. 30 6.7 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........ 31
table of contents 3/105 3 7 power saving modes . . . . . . . . . . ........................................... 32 7.1 introduction . ...................................................... 32 7.2 wait mode . . . . . . . . . . . ............................................... 33 7.3 stop mode . . . . . . .................................................... 34 7.4 notes related to wait and stop modes ......................... .... 36 7.4.1 exit from wait and stop modes . . . . ................................ .... 36 7.4.2 recommended mcu configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........ 36 8 i/o ports . . . . . . . . . . . . . . . . . . . . . . . . . . ........................................ 37 8.1 introduction . ...................................................... 37 8.2 functional description . . . . ........................................ 37 8.2.1 digital input modes . . . . . . ........................................... 37 8.2.2 analog inputs . . . . . . . ........................................... .... 37 8.2.3 output modes . . . . . . ........................................... .... 37 8.2.4 alternate functions . . . ........................................... .... 37 8.2.5 instructions not to be used to access port data registers (set, res, inc and dec) 39 8.2.6 recommendations . . . . . . . ........................................... 39 8.3 low power modes . . . . . . . . . . ........................................ 39 8.4 interrupts . . . . . . . . . . . . . . . . . . . . . . . . ................................. 39 8.5 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........ 41 9 on-chip peripherals . . . . . . . . . . . ........................................... 42 9.1 watchdog timer (wdg) . . . . . . . . . . . . . . . . . . . ........................... 42 9.1.1 introduction . . . .................................................... 42 9.1.2 main features . . . . . . ........................................... .... 42 9.1.3 functional description . . . . ........................................... 43 9.1.4 recommendations . . . . . . . ........................................... 43 9.1.5 low power modes . . . ............................................... 44 9.1.6 interrupts . . . . . . . . . . . . . . . . . . . . . . . . ................................. 44 9.1.7 register description . . . . . . ........................................... 45 9.2 8-bit timer . . . . ...................................................... 46 9.2.1 introduction . . . .................................................... 46 9.2.2 main features . . . . . . ........................................... .... 46 9.2.3 counter/prescaler description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........ 47 9.2.4 functional description . . . . ........................................... 48 9.2.5 low power modes . . . ............................................... 50 9.2.6 interrupts . . . . . ................................. ................... 50 9.2.7 register description . . . . . . ........................................... 51 9.3 a/d converter (adc) . . . . . . . . . . . . . . . . . . . . . ........................... 52 9.3.1 introduction . . . .................................................... 52 9.3.2 main features . . . . . . ........................................... .... 52 9.3.3 functional description . . . . . . . . . . . . . . . . . . . . ........................... 53 9.3.4 recommendations . . . . . . . ........................................... 54 9.3.5 low power modes . . . . . . . . . . . . . . . . . . ................................ 55 9.3.6 interrupts . . . . . . . . . . . . . . . . . . . . . . . . ................................. 55 9.3.7 register description . . . . . . ........................................... 55
table of contents 105 4/105 10 instruction set . . . . . . . . . . . . . . . . . . . . . . . . ............................. .... 56 10.1 st6 architecture . . . . . . . . . . . . . . . . . .................................. 56 10.2 addressing modes . . . . . . . . . . . . . . . . . . ................................ 56 10.3 instruction set . . . . . . . . . . . . . . . . . . . ................................. 57 11 electrical characteristics . . . . ......................................... 62 11.1 parameter conditions . . . . . . . . . . . . . . . . .............................. 62 11.1.1minimum and maximum values ........................................ 62 11.1.2typical values . . . . . . . . . . ........................................... 62 11.1.3typical curves . . . . . . . . . . . . . ........................................ 62 11.1.4loading capacitor . . . . . . . . . . . . . . . . . .................................. 62 11.1.5pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 11.2 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 11.2.1voltage characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 11.2.2current characteristics . . . . . . . . . . . . . . . . .............................. 63 11.2.3thermal characteristics . . . . . . . . . .................................... 63 11.3 operating conditions . . . . . . . . . . .................................... 64 11.3.1general operating conditions . . . . .................................... 64 11.3.2operating conditions with low voltage detector (lvd) . .................... 65 11.4 supply current characteristics . . . ................................ 66 11.4.1run modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................... 66 11.4.2wait modes . . . . . . . . . . . ........................................... 67 11.4.3stop mode . . . ................................................... 70 11.4.4supply and clock system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 11.4.5on-chip peripherals . . . . . ........................................... 71 11.5 clock and timing characteristics . . . . . . . . . . . . . . . . . . . . . . . ........... 72 11.5.1general timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 11.5.2external clock source . . . . . . . . . . . ................................ .... 72 11.5.3crystal and ceramic resonator oscillators . . . . ........................... 73 11.5.4rc oscillator . . .................................................... 74 11.5.5oscillator safeguard (osg) and low frequency auxiliary oscillator (lfao) . . . . . 75 11.6 memory characteristics . . . ........................................ 76 11.6.1ram and hardware registers . . . . . . . . . . . . . . . . . . . . . . . . . ............... 76 11.6.2eprom program memory . . . . . . . . . . ................................. 76 11.7 emc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 11.7.1functional ems . . . . . ............................................... 77 11.7.2absolute electrical sensitivity . . . . . . . . . . . . . . ........................... 78 11.7.3esd pin protection strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 11.8 i/o port pin characteristics ........................................ 81 11.8.1general characteristics . . . . . . . . . . . . .................................. 81 11.8.2output driving current . . . . ........................................... 82 11.9 control pin characteristics . . . . . .................................. 85 11.9.1asynchronous reset pin . . . . . . . . . . . . . . . . . ........................... 85 11.9.2nmi pin . . . . . . . . . . . . . . . ........................................... 86 1
table of contents 5/105 11.10 timer peripheral characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . ........ 87 11.10.1watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........ 87 11.10.28-bit timer . . . . . . . . . . . . ........................................... 87 11.11 8-bit adc characteristics . . . . . . . . .................................. 88 12 general information .................................................... 90 12.1 package mechanical data . . . . . . . . . . . . .............................. 90 12.2 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . .................... 92 12.3 soldering and glueability information . . . . . . . . . . . . . . . . . . . . . ........ 93 12.4 package/socket footprint proposal . . . . . . . . . . . .................... 94 12.5 ordering information . . . . . . . . . . . . . . . . .............................. 95 12.6 transfer of customer code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........ 96 12.6.1fastrom version . . . ............................................... 96 12.6.2rom version .................................................... 98 13 development tools . . . . . . . . . . .......................................... 100 14 st6 application notes . . . . . . . . . . . . . . . . . . . . . ............................. 102 15 summary of changes . .................................................. 104 16 to get more information . .............................................. 104 1
ST6208C/st6209c/st6210c/st6220c 6/105 1 introduction the ST6208C, 09c, 10c and 20c devices are low cost members of the st62xx 8-bit hcmos family of microcontrollers, which is targeted at low to me- dium complexity applications. all st62xx devices are based on a building block approach: a com- mon core is surrounded by a number of on-chip peripherals. the st62e20c is the erasable eprom version of the st62t08c, t09c, t10c and t20c devices, which may be used during the development phase for the st62t08c, t09c, t10c and t20c target devices, as well as the respective ST6208C, 09c, 10c and 20c rom devices. otp and eprom devices are functionally identi- cal. otp devices offer all the advantages of user programmability at low cost, which make them the ideal choice in a wide range of applications where frequent code changes, multiple code versions or last minute programmability are required. the rom based versions offer the same function- ality, selecting the options defined in the program- mable option bytes of the otp/eprom versions in the rom option list (see section 12.6 on page 96). the st62p08c/p09c/p10c/p20c are the f actory a dvanced s ervice t echnique rom (fastrom) versions of st62t08c, t09c, t10c and t20c otp devices. they offer the same functionality as otp devices, but they do not have to be programmed by the customer (see section 12 on page 90). these compact low-cost devices feature a timer comprising an 8-bit counter with a 7-bit program- mable prescaler, an 8-bit a/d converter with up to 8 analog inputs (depending on device) and a dig- ital watchdog timer, making them well suited for a wide range of automotive, appliance and industrial applications. for easy reference, all parametric data are located in section 11 on page 62. figure 1. block diagram test nmi interrupts program pc stac k level 1 stac k level 2 stac k level 3 stac k level 4 stac k level 5 stac k level 6 powe r supply oscillator reset data rom user selectable data ram 64 bytes port a port b timer 8-bit core test/ v pp 8-bit * a/d converte r pa0..pa3 (20ma sink) pb0..pb7 / ain* timer v dd v ss oscin oscout reset watchdog : memory timer (1k, 2k * depending on device. see device summary on page 1. or 4k bytes) 4
ST6208C/st6209c/st6210c/st6220c 7/105 2 pin description figure 2. 20-pin package pinout table 1. device pin description v dd timer ain*/pb5 ain*/pb6 ain*/pb7 reset v pp /test nmi oscout oscin v ss pa0/20ma sink pb4/ain* pb3/ain* pb2/ain* pb1/ain* pb0/ain* pa3/20ma sink pa2/20ma sink pa1/20ma sink itx associated interrupt vector 1 2 3 4 5 6 7 8 9 10 11 12 20 19 18 17 16 15 14 13 * depending on device. see device summary on page 1 it2 it1 it2 pin n pin name type main function (after reset) alternate function 1v dd s main power supply 2 timer i/o timer input or output 3 oscin i external clock input or resonator oscillator inverter input 4 oscout o resonator oscillator inverter output or resistor input for rc oscillator 5 nmi i non maskable interrupt (falling edge sensitive) 6v pp /test must be held at vss for normal operation, if a 12.5v level is applied to the pin during the reset phase, the device enters eprom programming mode. 7 reset i/o top priority non maskable interrupt (active low) 8 pb7/ain* i/o pin b7 (ipu) analog input 9 pb6/ain* i/o pin b6 (ipu) analog input 10 pb5/ain* i/o pin b5 (ipu) analog input 11 pb4/ain* i/o pin b4 (ipu) analog input 12 pb3/ain* i/o pin b3 (ipu) analog input 13 pb2/ain* i/o pin b2 (ipu) analog input 14 pb1/ain* i/o pin b1 (ipu) analog input 15 pb0/ain* i/o pin b0 (ipu) analog input 16 pa3/ 20ma sink i/o pin a3 (ipu) 17 pa2/ 20ma sink i/o pin a2 (ipu) 18 pa1/ 20ma sink i/o pin a1 (ipu) 5
ST6208C/st6209c/st6210c/st6220c 8/105 legend / abbreviations for table 1 : * depending on device. see device summary on page 1. i = input, o = output, s = supply, ipu = input with pull-up the input with pull-up configuration (reset state) is valid as long as the user software does not change it. refer to section 8 oi/o portso on page 37 for more details on the software configuration of the i/o ports. 19 pa0/ 20ma sink i/o pin a0 (ipu) 20 v ss s ground pin n pin name type main function (after reset) alternate function 6
ST6208C/st6209c/st6210c/st6220c 9/105 3 memory maps, programming modes and option bytes 3.1 memory and register maps 3.1.1 introduction the mcu operates in three separate memory spaces: program space, data space, and stack space. operation in these three memory spaces is described in the following paragraphs. briefly, program space contains user program code in otp and user vectors; data space con- tains user data in ram and in otp, and stack space accommodates six levels of stack for sub- routine and interrupt service routine nesting. figure 3. memory addressing diagram program space program interrupt & reset vectors accumulator ram x register y register v register w register 000h 03fh 040h 07fh 080h 081h 082h 083h 084h 0c0h 0ffh data space 000h 0ff0h 0fffh memory window data rom reserved hardware control registers 0bfh (see table 2) (see figure 4) 1
ST6208C/st6209c/st6210c/st6220c 10/105 memory map (cont'd) figure 4. program memory map (*) reserved areas should be filled with 0ffh 0000h 0affh 0b00h 0b9fh not implemented reserved * user program memory 1024 bytes 0ba0h 0f9fh 0fa0h 0fefh 0ff0h 0ff7h 0ff8h 0ffbh 0ffch 0ffdh 0ffeh 0fffh reserved * reserved * interrupt vectors nmi vector user reset vector 0000h 07fh user program memory 3872 bytes 080h 0f9fh 0fa0h 0fefh 0ff0h 0ff7h 0ff8h 0ffbh 0ffch 0ffdh 0ffeh 0fffh reserved * reserved * interrupt vectors nmi vector user reset vector reserved * 0000h 07ffh 0800h 087fh not implemented reserved * user program memory 1824 bytes 0880h 0f9fh 0fa0h 0fefh 0ff0h 0ff7h 0ff8h 0ffbh 0ffch 0ffdh 0ffeh 0fffh reserved * reserved * interrupt vectors nmi vector user reset vector ST6208C, 09c st6210c st6220c 1
ST6208C/st6209c/st6210c/st6220c 11/105 memory map (cont'd) 3.1.2 program space program space comprises the instructions to be executed, the data required for immediate ad- dressing mode instructions, the reserved factory test area and the user vectors. program space is addressed via the 12-bit program counter register (pc register). thus, the mcu is capable of ad- dressing 4k bytes of memory directly. 3.1.3 readout protection the program memory in otp, eprom or rom devices can be protected against external readout of memory by setting the readout protection bit in the option bytes (section 3.3 on page 16). in the eprom parts, readout protection option can be desactivated only by u.v. erasure that also results in the whole eprom context being erased. note: once the readout protection is activated, it is no longer possible, even for stmicroelectronics, to gain access to the otp or rom contents. re- turned parts can therefore not be accepted if the readout protection bit is set. 3.1.4 data space data space accommodates all the data necessary for processing the user program. this space com- prises the ram resource, the processor core and peripheral registers, as well as read-only data such as constants and look-up tables in otp/ eprom. 3.1.4.1 data rom all read-only data is physically stored in program memory, which also accommodates the program space. the program memory consequently con- tains the program code to be executed, as well as the constants and look-up tables required by the application. the data space locations in which the different constants and look-up tables are addressed by the processor core may be thought of as a 64-byte window through which it is possible to access the read-only data stored in otp/eprom. 3.1.4.2 data ram the data space includes the user ram area, the accumulator (a), the indirect registers (x), (y), the short direct registers (v), (w), the i/o port regis- ters, the peripheral data and control registers, the interrupt option register and the data rom win- dow register (drwr register). 3.1.5 stack space stack space consists of six 12-bit registers which are used to stack subroutine and interrupt return addresses, as well as the current program counter contents. 1
ST6208C/st6209c/st6210c/st6220c 12/105 memory map (cont'd) table 2. hardware register map legend : x = undefined, r/w = read/write, ro = read-only bit(s) in the register, wo = write-only bit(s) in the register. notes : 1. the contents of the i/o port dr registers are readable only in output configuration. in input configura- tion, the values of the i/o pins are returned instead of the dr register contents. 2. the bits associated with unavailable pins must always be kept at their reset value. 3. do not use single-bit instructions (set, res...) on port data registers if any pin of the port is configured in input mode (refer to section 8 oi/o portso on page 37 for more details) 4. depending on device. see device summary on page 1. address block register label register name reset status remarks 080h to 083h cpu x,y,v,w x,y index registers v,w short direct registers xxh r/w 0c0h 0c1h i/o ports dra 1) 2) 3) drb 1) 2) 3) port a data register port b data register 00h 00h r/w r/w 0c2h 0c3h reserved (2 bytes) 0c4h 0c5h i/o ports ddra 2) ddrb 2) port a direction register port b direction register 00h 00h r/w r/w 0c6h 0c7h reserved (2 bytes) 0c8h ior interrupt option register xxh write-only 0c9h drwr data rom window register xxh write-only 0cah 0cbh reserved (2 bytes) 0cch 0cdh i/o ports ora 2) orb 2) port a option register port b option register 00h 00h r/w r/w 0ceh 0cfh reserved (2 bytes) 0d0h 0d1h adc 4) adr adcr a/d converter data register a/d converter control register xxh 40h read-only ro/wo 0d2h 0d3h 0d4h timer1 pscr tcr tscr timer 1 prescaler register timer 1 downcounter register timer 1 status control register 7fh 0ffh 00h r/w r/w r/w 0d5h to 0d7h reserved (3 bytes) 0d8h watchdog timer wdgr watchdog register 0feh r/w 0d9h to 0feh reserved (38 bytes) 0ff cpu a accumulator xxh r/w 1
ST6208C/st6209c/st6210c/st6220c 13/105 memory map (cont'd) 3.1.6 data rom window the data read-only memory window is located from address 0040h to address 007fh in data space. it allows direct reading of 64 consecutive bytes located anywhere in program memory, be- tween address 0000h and 0fffh. there are 64 blocks of 64 bytes in a 4k device: block 0 is related to the address range 0000h to 003fh. block 1 is related to the address range 0040h to 007fh. and so on... all the program memory can therefore be used to store either instructions or read-only data. the data rom window can be moved in steps of 64 bytes along the program memory by writing the appropriate code in the data rom window regis- ter (drwr). figure 5. data rom window 3.1.6.1 data rom window register (drwr) the drwr can be addressed like any ram loca- tion in the data space. this register is used to select the 64-byte block of program memory to be read in the data rom win- dow (from address 40h to address 7fh in data space). the drwr register is not cleared on re- set, therefore it must be written to before access- ing the data read-only memory window area for the first time. address: 0c9h e write only reset value = xxh (undefined) bits 6, 7 = not used. bit 5:0 = drwr[5:0] data read-only memory win- dow register bits. these are the data read-only memory window bits that correspond to the upper bits of the data read-only memory space. caution: this register is undefined on reset, it is write-only, therefore do not read it nor access it us- ing single-bit instructions (set, res...). 0000h 0fffh 000h 040h 07fh 0ffh data rom window data space 64-byte rom program space 70 - - drwr5 drwr4 drwr3 drwr 2 drwr1 drwr0 1
ST6208C/st6209c/st6210c/st6220c 14/105 memory map (cont'd) 3.1.6.2 data rom window memory addressing in cases where some data (look-up tables for ex- ample) are stored in program memory, reading these data requires the use of the data rom win- dow mechanism. to do this: 1. the drwr register has to be loaded with the 64-byte block number where the data are located (in program memory). this number also gives the start address of the block. 2. then, the offset address of the byte in the data rom window (corresponding to the offset in the 64-byte block in program memory) has to be load- ed in a register (a, x,...). when the above two steps are completed, the data can be read. to understand how to determine the drwr and the content of the register, please refer to the ex- ample shown in figure 6. in any case the calcula- tion is automatically handled by the st6 develop- ment tools. please refer to the user manual of the correspod- ing tool. 3.1.6.3 recommendations care is required when handling the drwr regis- ter as it is write only. for this reason, the drwr contents should not be changed while executing an interrupt service routine, as the service routine cannot save and then restore the register's previ- ous contents. if it is impossible to avoid writing to the drwr during the interrupt service routine, an image of the register must be saved in a ram lo- cation, and each time the program writes to the drwr, it must also write to the image register. the image register must be written first so that, if an interrupt occurs between the two instructions, the drwr is not affected. figure 6. data rom window memory addressing data program space data space 0000h 0400h 0421h 07ffh 64 bytes offset 000h 040h 061h 07fh offset 21h 0ffh drwr data address in program memory : 421h drwr content : 421h / 3fh (64) = 10h data is located in 64-bytes window number 10h 64-byte window start address : 10h x 3fh = 400h register (a, x,...)content : offset = (421h - 400h) + 40h ( data rom window start address in data space) = 61h 10h data 1
ST6208C/st6209c/st6210c/st6220c 15/105 3.2 programming modes 3.2.1 program memory eprom/otp programming mode is set by a +12.5v voltage applied to the test/v pp pin. the programming flow of the st62t08c,t09c,t10c, t20c and e20c is described in the user manual of the eprom programming board. table 3. ST6208C/09c program memory map table 4. st6210c program memory map table 5. st6220c program memory map note : otp/eprom devices can be programmed with the development tools available from stmicroelectronics (please refer to section 13 on page 100). 3.2.2 eprom erasing the eprom devices can be erased by exposure to ultra violet light. the characteristics of the mcu are such that erasure begins when the memory is exposed to light with a wave lengths shorter than approximately 4000?. it should be noted that sun- light and some types of fluorescent lamps have wavelengths in the range 3000-4000?. it is thus recommended that the window of the mcu packages be covered by an opaque label to prevent unintentional erasure problems when test- ing the application in such an environment. the recommended erasure procedure is exposure to short wave ultraviolet light which have a wave- length 2537?. the integrated dose (i.e. u.v. inten- sity x exposure time) for erasure should be a mini- mum of 30w-sec/cm 2 . the erasure time with this dosage is approximately 30 to 40 minutes using an ultraviolet lamp with 12000 m w/cm 2 power rating. the eprom device should be placed within 2.5cm (1inch) of the lamp tubes during erasure. device address description 0000h-0b9fh 0ba0h-0f9fh 0fa0h-0fefh 0ff0h-0ff7h 0ff8h-0ffbh 0ffch-0ffdh 0ffeh-0fff h reserved user rom reserved interrupt vectors reserved nmi interrupt vector reset vector device address description 0000h-087fh 0880h-0f9fh 0fa0h-0fefh 0ff0h-0ff7h 0ff8h-0ffbh 0ffch-0ffdh 0ffeh-0fff h reserved user rom reserved interrupt vectors reserved nmi interrupt vector reset vector device address description 0000h-007fh 0080h-0f9fh 0fa0h-0fefh 0ff0h-0ff7h 0ff8h-0ffbh 0ffch-0ffdh 0ffeh-0fff h reserved user rom reserved interrupt vectors reserved nmi interrupt vector reset vector 1
ST6208C/st6209c/st6210c/st6220c 16/105 3.3 option bytes each device is available for production in user pro- grammable versions (otp) as well as in factory coded versions (rom). otp devices are shipped to customers with a default content (00h), while rom factory coded parts contain the code sup- plied by the customer. this implies that otp de- vices have to be configured by the customer using the option bytes while the rom devices are facto- ry-configured. the two option bytes allow the hardware configu- ration of the microcontroller to be selected. the option bytes have no address in the memory map and can be accessed only in programming mode (for example using a standard st6 program- ming tool). in masked rom devices, the option bytes are fixed in hardware by the rom code (see section 12.6.2 orom versiono on page 98). the option bytes can be only programmed once. it is not possible to change the selected options after they have been programmed. msb option byte bit 15:10 = reserved, must be always cleared. bit 9 = extcntl external stop mode control . 0: extcntl mode not available. stop mode is not available with the watchdog active. 1: extcntl mode available. stop mode is avail- able with the watchdog active by setting nmi pin to one. bit 8 = lvd low voltage detector on/off . this option bit enable or disable the low voltage detector (lvd) feature. 0: low voltage detector disabled 1: low voltage detector enabled lsb option byte bit 7 = protect readout protection. this option bit enables or disables external access to the internal program memory. 0: program memory not read-out protected 1: program memory read-out protected bit 6 = osc oscillator selection . this option bit selects the main oscillator type. 0: quartz crystal, ceramic resonator or external clock 1: rc network bit 5 = reserved, must be always cleared. bit 4 = reserved, must be always set. bit 3 = nmi pull nmi pull-up on/off. this option bit enables or disables the internal pull- up on the nmi pin. 0: pull-up disabled 1: pull-up enabled bit 2 = tim pull timer pull-up on/off. this option bit enables or disables the internal pull- up on the timer pin. 0: pull-up disabled 1: pull-up enabled bit 1 = wdact hardware or software watchdog. this option bit selects the watchdog type. 0: software (watchdog to be enabled by software) 1: hardware (watchdog always enabled) bit 0 = osgen oscillator safeguard on/off. this option bit enables or disables the oscillator safeguard (osg) feature. 0: oscillator safeguard disabled 1: oscillator safeguard enabled msb option byte 15 8 lsb option byte 70 reserved ext ctl lvd pro- tect osc res. res. nmi pull tim pull wd act osg en default value xxxxxxxxxxxxx x x x 1
ST6208C/st6209c/st6210c/st6220c 17/105 4 central processing unit 4.1 introduction the cpu core of st6 devices is independent of the i/o or memory configuration. as such, it may be thought of as an independent central processor communicating with on-chip i/o, memory and pe- ripherals via internal address, data, and control buses. 4.2 main features n 40 basic instructions n 9 main addressing modes n two 8-bit index registers n two 8-bit short direct registers n low power modes n maskable hardware interrupts n 6-level hardware stack 4.3 cpu registers the st6 family cpu core features six registers and three pairs of flags available to the programmer. these are described in the following paragraphs. accumulator (a) . the accumulator is an 8-bit general purpose register used in all arithmetic cal- culations, logical operations, and data manipula- tions. the accumulator can be addressed in data space as a ram location at address ffh. thus the st6 can manipulate the accumulator just like any other register in data space. index registers (x, y). these two registers are used in indirect addressing mode as pointers to memory locations in data space. they can also be accessed in direct, short direct, or bit direct addressing modes. they are mapped in data space at addresses 80h (x) and 81h (y) and can be accessed like any other memory location. short direct registers (v, w). these two regis- ters are used in short direct addressing mode. this means that the data stored in v or w can be accessed with a one-byte instruction (four cpu cy- cles). v and w can also be accessed using direct and bit direct addressing modes. they are mapped in data space at addresses 82h (v) and 83h (w) and can be accessed like any other mem- ory location. note : the x and y registers can also be used as short direct registers in the same way as v and w. program counter (pc) . the program counter is a 12-bit register which contains the address of the next instruction to be executed by the core. this rom location may be an opcode, an operand, or the address of an operand. figure 7. cpu registers accumulator x index register y index register program counter reset value = reset vector @ 0ffeh-0fffh 70 70 70 0 11 reset value = xxh reset value = xxh reset value = xxh x = undefined value v short indirect 70 reset value = xxh w short indirect 70 reset value = xxh normal flags cn zn ci zi cnmi znmi interrupt flags nmi flags six level stack register register 1
ST6208C/st6209c/st6210c/st6220c 18/105 cpu registers (cont'd) the 12-bit length allows the direct addressing of 4096 bytes in program space. however, if the program space contains more than 4096 bytes, the additional memory in program space can be addressed by using the program rom page register. the pc value is incremented after reading the ad- dress of the current instruction. to execute relative jumps, the pc and the offset are shifted through the alu, where they are added; the result is then shifted back into the pc. the program counter can be changed in the following ways: jp (jump) instruction pc = jump address call instruction pc = call address relative branch instructionpc = pc +/- offset interrupt pc = interrupt vector reset pc = reset vector ret & reti instructions pc = pop (stack) normal instruction pc = pc + 1 flags (c, z) . the st6 cpu includes three pairs of flags (carry and zero), each pair being associated with one of the three normal modes of operation: normal mode, interrupt mode and non maskable interrupt mode. each pair consists of a carry flag and a zero flag. one pair (cn, zn) is used during normal operation, another pair is used dur- ing interrupt mode (ci, zi), and a third pair is used in the non maskable interrupt mode (cnmi, zn- mi). the st6 cpu uses the pair of flags associated with the current mode: as soon as an interrupt (or a non maskable interrupt) is generated, the st6 cpu uses the interrupt flags (or the nmi flags) in- stead of the normal flags. when the reti instruc- tion is executed, the previously used set of flags is restored. it should be noted that each flag set can only be addressed in its own context (non maska- ble interrupt, normal interrupt or main routine). the flags are not cleared during context switching and thus retain their status. c : carry flag. this bit is set when a carry or a borrow occurs dur- ing arithmetic operations; otherwise it is cleared. the carry flag is also set to the value of the bit tested in a bit test instruction; it also participates in the rotate left instruction. 0: no carry has occured 1: a carry has occured z : zero flag this flag is set if the result of the last arithmetic or logical operation was equal to zero; otherwise it is cleared. 0: the result of the last operation is different from zero 1: the result of the last operation is zero switching between the three sets of flags is per- formed automatically when an nmi, an interrupt or a reti instruction occurs. as nmi mode is auto- matically selected after the reset of the mcu, the st6 core uses the nmi flags first. stack. the st6 cpu includes a true lifo (last in first out) hardware stack which eliminates the need for a stack pointer. the stack consists of six separate 12-bit ram locations that do not belong to the data space ram area. when a subroutine call (or interrupt request) occurs, the contents of each level are shifted into the next level down, while the content of the pc is shifted into the first level (the original contents of the sixth stack level are lost). when a subroutine or interrupt return oc- curs (ret or reti instructions), the first level reg- ister is shifted back into the pc and the value of each level is popped back into the previous level. figure 8. stack manipulation since the accumulator, in common with all other data space registers, is not stored in this stack, management of these registers should be per- formed within the subroutine. caution: the stack will remain in its adeepesto po- sition if more than 6 nested calls or interrupts are executed, and consequently the last return ad- dress will be lost. it will also remain in its highest position if the stack is empty and a ret or reti is executed. in this case the next instruction will be executed. level 1 level 2 level 3 level 4 level 5 level 6 on interrupt, or subroutine call on return from interrup t, or subrou tine program counter 1
ST6208C/st6209c/st6210c/st6220c 19/105 5 clocks, supply and reset 5.1 clock system the main oscillator of the mcu can be driven by any of these clock sources: external clock signal external at-cut parallel-resonant crystal external ceramic resonator external rc network (r net ). in addition, an on-chip low frequency auxiliary oscillator (lfao) is available as a back-up clock system or to reduce power consumption. an optional oscillator safeguard (osg) filters spikes from the oscillator lines, and switches to the lfao backup oscillator in the event of main oscil- lator failure. it also automatically limits the internal clock frequency (f int ) as a function of v dd , in order to guarantee correct operation. these functions are illustrated in figure 10, and figure 11. table 6 illustrates various possible oscillator con- figurations using an external crystal or ceramic resonator, an external clock input, an external re- sistor (r net ), or the lowest cost solution using only the lfao. for more details on configuring the clock options, refer to the option bytes section of this document. the internal mcu clock frequency (f int ) is divided by 12 to drive the timer, the watchdog timer and the a/d converter (if available), and by 13 to drive the cpu core, as shown in figure 9. with an 8 mhz oscillator, the fastest cpu cycle is therefore 1.625 m s. a cpu cycle is the smallest unit of time needed to execute any operation (for instance, to increment the program counter). an instruction may require two, four, or five cpu cycles for execution. figure 9. clock circuit block diagram main oscillator osg lfao core :13 :12 8-bit timer watchdog f int oscoff bit adc 0 1 filtering oscillator safegu ard (osg) osg enable option bit (see option byte section) (adcr register ) f osc * depending on device. see device summary on page 1. * * 1
ST6208C/st6209c/st6210c/st6220c 20/105 clock system (cont'd) 5.1.1 main oscillator the oscillator configuration is specified by select- ing the appropriate option in the option bytes (refer to the option bytes section of this document). when the crystal/resonator option is se- lected, it must be used with a quartz crystal, a ce- ramic resonator or an external signal provided on the oscin pin. when the rc network option is selected, the system clock is generated by an ex- ternal resistor (the capacitor is implemented inter- nally). the main oscillator can be turned off (when the osg enabled option is selected) by setting the oscoff bit of the adc control register (not available on some devices). this will automatically start the low frequency auxiliary oscillator (lfao). the main oscillator can be turned off by resetting the oscoff bit of the a/d converter control reg- ister or by resetting the mcu. when the main os- cillator starts there is a delay made up of the oscil- lator start-up delay period plus the duration of the software instruction at a clock frequency f lfao . caution: it should be noted that when the rc net- work option is selected, the accuracy of the fre- quency is about 20% so it may not be suitable for some applications (for more details, please refer to the electrical characteristics section). table 6. oscillator configurations notes: 1. to select the options shown in column 1 of the above table, refer to the option byte section. 2.this schematic are given for guidance only and are sub- ject to the schematics given by the crystal or ceramic res- onator manufacturer. 3. for more details, please refer to the electrical charac- teristics section. hardware configuration crystal/resonator option 1) crystal/resonator option 1) rc network option 1) osg enabled option 1) oscin oscout external st6 clock nc external clock oscin oscout load capacitors 3) st6 c l2 c l1 crystal/resonator clock 2) oscin oscout st6 r net nc rc network oscin oscout st6 lfao nc 1
ST6208C/st6209c/st6210c/st6220c 21/105 clock system (cont'd) 5.1.2 oscillator safeguard (osg) the oscillator safeguard (osg) feature is a means of dramatically improving the operational integrity of the mcu. it is available when the osg enabled option is selected in the option byte (re- fer to the option bytes section of this document). the osg acts as a filter whose cross-over fre- quency is device dependent and provides three basic functions: filtering spikes on the oscillator lines which would result in driving the cpu at excessive fre- quencies management of the low frequency auxiliary oscillator (lfao), (useable as low cost internal clock source, backup clock in case of main oscil- lator failure or for low power consumption) automatically limiting the f int clock frequency as a function of supply voltage, to ensure correct operation even if the power supply drops. 5.1.2.1 spike filtering spikes on the oscillator lines result in an effectively increased internal clock frequency. in the absence of an osg circuit, this may lead to an over fre- quency for a given power supply voltage. the osg filters out such spikes (as illustrated in figure 10). in all cases, when the osg is active, the max- imum internal clock frequency, f int , is limited to f osg , which is supply voltage dependent. 5.1.2.2 management of supply voltage variations over-frequency, at a given power supply level, is seen by the osg as spikes; it therefore filters out some cycles in order that the internal clock fre- quency of the device is kept within the range the particular device can stand (depending on v dd ), and below f osg : the maximum authorised frequen- cy with osg enabled. 5.1.2.3 lfao management when the osg is enabled, the low frequency auxiliary oscillator can be used (see section 5.1.3). note: the osg should be used wherever possible as it provides maximum security for the applica- tion. it should be noted however, that it can in- crease power consumption and reduce the maxi- mum operating frequency to f osg (see electrical characteristics section). caution: care has to be taken when using the osg, as the internal frequency is defined between a minimum and a maximum value and may vary depending on both v dd and temperature. for pre- cise timing measurements, it is not recommended to use the osg. figure 10. osg filtering function figure 11. lfao oscillator function f osc f osg f int f osc< f osg f osc> f osg main oscillator stops main oscillator restarts inte rnal clock driven by lfao f osc f int f lfao 1
ST6208C/st6209c/st6210c/st6220c 22/105 clock system (cont'd) 5.1.3 low frequency auxiliary oscillator (lfao) the low frequency auxiliary oscillator has three main purposes. firstly, it can be used to reduce power consumption in non timing critical routines. secondly, it offers a fully integrated system clock, without any external components. lastly, it acts as a backup oscillator in case of main oscillator fail- ure. this oscillator is available when the osg ena- bled option is selected in the option byte (refer to the option bytes section of this document). in this case, it automatically starts one of its periods after the first missing edge of the main oscillator, what- ever the reason for the failure (main oscillator de- fective, no clock circuitry provided, main oscillator switched off...). see figure 11. user code, normal interrupts, wait and stop in- structions, are processed as normal, at the re- duced f lfao frequency. the a/d converter accura- cy is decreased, since the internal frequency is be- low 1.2 mhz. at power on, until the main oscillator starts, the 2048 clock cycle counter is driven by the lfao. if the main oscillator starts before the 2048 cycle de- lay has elapsed, it takes over. the low frequency auxiliary oscillator is auto- matically switched off as soon as the main oscilla- tor starts. 5.1.4 register description adc control register (adcr) address: 0d1h e read/write reset value: 0100 0000 (40h) bit 7:3, 1:0 = adcr[7:3], adcr[1:0] adc control register . these bits are used to control the a/d converter (if available on the device) otherwise they are not used. bit 2 = oscoff main oscillator off. 0: main oscillator enabled 1: main oscillator disabled note: the osg must be enabled using the os- gen option in the option byte, otherwise the os- coff setting has no effect. 70 adcr 7 adcr 6 adcr 5 adcr 4 adcr 3 osc off adcr 1 adcr 0 1
ST6208C/st6209c/st6210c/st6220c 23/105 5.2 low voltage detector (lvd) the on-chip low voltage detector is enabled by setting a bit in the option bytes (refer to the option bytes section of this document). the lvd allows the device to be used without any external reset circuitry. in this case, the reset pin should be left unconnected. if the lvd is not used, an external circuit is manda- tory to ensure correct power on reset operation, see figure in the reset section. for more details, please refer to the application note an669. the lvd generates a static reset when the supply voltage is below a reference value. this means that it secures the power-up as well as the power- down keeping the st6 in reset. the v it- reference value for a voltage drop is lower than the v it+ reference value for power-on in order to avoid a parasitic reset when the mcu starts run- ning and sinks current on the supply (hysteresis). the lvd reset circuitry generates a reset when v dd is below: v it+ when v dd is rising v it- when v dd is falling the lvd function is illustrated in figure 12. if the lvd is enabled, the mcu can be in only one of two states: over the input threshold voltage, it is running un- der full software control below the input threshold voltage, it is in static safe reset in these conditions, secure operation is guaran- teed without the need for external reset hardware. during a low voltage detector reset, the reset pin is held low, thus permitting the mcu to reset other devices. figure 12. low voltage detector reset v dd v it+ reset v it- v hyst 1
ST6208C/st6209c/st6210c/st6220c 24/105 5.3 reset 5.3.1 introduction the mcu can be reset in three ways: n a low pulse input on the reset pin n internal watchdog reset n internal low voltage detector (lvd) reset 5.3.2 reset sequence the basic reset sequence consists of 3 main phases: n internal (watchdog or lvd) or external reset event n a delay of 2048 clock (f int ) cycles n reset vector fetch the 2048 clock cycle delay allows the oscillator to stabilise and ensures that recovery has taken place from the reset state. the reset vector fetch phase duration is 2 clock cycles. when a reset occurs: the stack is cleared the pc is loaded with the address of the reset vector. it is located in program rom starting at address 0ffeh. a jump to the beginning of the user program must be coded at this address. the interrupt flag is automatically set, so that the cpu is in non maskable interrupt mode. this prevents the initialization routine from being in- terrupted. the initialization routine should there- fore be terminated by a reti instruction, in order to go back to normal mode. figure 13. reset sequence v dd reset pin watchdog v it+ v it- watchdog underflow reset 2048 clock cycle (f int ) delay lvd reset internal run reset run run run reset reset reset 1
ST6208C/st6209c/st6210c/st6220c 25/105 reset (cont'd) 5.3.3 reset pin the reset pin may be connected to a device on the application board in order to reset the mcu if required. the reset pin may be pulled low in run, wait or stop mode. this input can be used to reset the internal state of the mcu and en- sure it starts-up correctly. the pin, which is con- nected to an internal pull-up, is active low and fea- tures a schmitt trigger input. a delay (2048 clock cycles) added to the external signal ensures that even short pulses on the reset pin are accepted as valid, provided v dd has completed its rising phase and that the oscillator is running correctly (normal run or wait modes). the mcu is kept in the reset state as long as the reset pin is held low. if the reset pin is grounded while the mcu is in run or wait modes, processing of the user pro- gram is stopped (run mode only), the i/o ports are configured as inputs with pull-up resistors and the main oscillator is restarted. when the level on the reset pin then goes high, the initialization se- quence is executed at the end of the internal delay period. if the reset pin is grounded while the mcu is in stop mode, the oscillator starts up and all the i/o ports are configured as inputs with pull-up resis- tors. when the reset pin level then goes high, the initialization sequence is executed at the end of the internal delay period. a simple external reset circuitry is shown in fig- ure 15. for more details, please refer to the appli- cation note an669. figure 14. reset block diagram f int counter reset watchdog reset lvd reset internal reset r esd 1) 1) resistive esd protection v dd r pu 2048 clock cycles 1
ST6208C/st6209c/st6210c/st6220c 26/105 reset (cont'd) 5.3.4 watchdog reset the mcu provides a watchdog timer function in order to be able to recover from software hang- ups. if the watchdog register is not refreshed be- fore an end-of-count condition is reached, a watchdog reset is generated. after a watchdog reset, the mcu restarts in the same way as if a reset was generated by the re- set pin. note: when a watchdog reset occurs, the reset pin is tied low for very short time period, to flag the reset phase. this time is not long enough to reset external circuits. for more details refer to the watchdog timer chapter. 5.3.5 lvd reset two different reset sequences caused by the in- ternal lvd circuitry can be distinguished: n power-on reset n voltage drop reset during an lvd reset, the reset pin is pulled low when v dd 4.7 k int latch cleared nmi mask set (if present) select nmi mode flags is reset still present? yes put ffeh on address bus from reset locations ffe h/fffh no fetch instr uction load pc inte rnal reset reset 2048 clock cycle delay 1
ST6208C/st6209c/st6210c/st6220c 27/105 6 interrupts the st6 core may be interrupted by four maska- ble interrupt sources, in addition to a non maska- ble interrupt (nmi) source. the interrupt process- ing flowchart is shown in figure 18. maskable interrupts must be enabled by setting the gen bit in the ior register. however, even if they are disabled (gen bit = 0), interrupt events are latched and may be processed as soon as the gen bit is set. each source is associated with a specific interrupt vector, located in program space (see table 8). in the vector location, the user must write a jump in- struction to the associated interrupt service rou- tine. when an interrupt source generates an interrupt request, the pc register is loaded with the address of the interrupt vector, which then causes a jump to the relevant interrupt service routine, thus serv- icing the interrupt. interrupt are triggered by events either on external pins, or from the on-chip peripherals. several events can be ored on the same interrupt vector. on-chip peripherals have flag registers to deter- mine which event triggered the interrupt. figure 17. interrupts block diagram nmi esb bit v dd latch cleared by h/w at start of vector #0 routine vector #0 les bit 1 0 latch cleared by h/w at start of vector #1 vecto r #2 vector #3 vector #4 latch cleared by h/w at start of vector #2 routine i/o port register configuration ainput with interrupto i/o port register configuration ainput with interrupto exit from stop/wai t vector #1 routine timer a/d converter * tmz bit eti bit eai bit eoc bit gen bit pb0...pb7 pa0...p a3 (tscr register) (adcr register) (ior register) (ior register) (ior registe r) * depending on device. see device summary on page 1. 1
ST6208C/st6209c/st6210c/st6220c 28/105 6.1 interrupt rules and priority management n a reset can interrupt the nmi and peripheral interrupt routines n the non maskable interrupt request has the highest priority and can interrupt any peripheral interrupt routine at any time but cannot interrupt another nmi interrupt. n no peripheral interrupt can interrupt another. if more than one interrupt request is pending, these are processed by the processor core according to their priority level: vector #1 has the highest priority while vector #4 the lowest. the priority of each interrupt source is fixed by hardware (see interrupt mapping table). 6.2 interrupts and low power modes all interrupts cause the processor to exit from wait mode. only the external and some specific interrupts from the on-chip peripherals cause the processor to exit from stop mode (refer to the aexit from stopa column in the interrupt mapping table). 6.3 non maskable interrupt this interrupt is triggered when a falling edge oc- curs on the nmi pin regardless of the state of the gen bit in the ior register. an interrupt request on nmi vector #0 is latched by a flip flop which is automatically reset by the core at the beginning of the nmi service routine. 6.4 peripheral interrupts different peripheral interrupt flags in the peripheral control registers are able to cause an interrupt when they are active if both: the gen bit of the ior register is set the corresponding enable bit is set in the periph- eral control register. peripheral interrupts are linked to vectors #3 and #4. interrupt requests are flagged by a bit in their corresponding control register. this means that a request cannot be lost, because the flag bit must be cleared by user software. 1
ST6208C/st6209c/st6210c/st6220c 29/105 6.5 external interrupts (i/o ports) external interrupt vectors can be loaded into the pc register if the corresponding external interrupt occurred and if the gen bit is set. these interrupts allow the processor to exit from stop mode. the external interrupt polarity is selected through the ior register. external interrupts are linked to vectors #1 and # 2. interrupt requests on vector #1 can be configured either as edge or level-sensitive using the les bit in the ior register. interrupt requests from vector #2 are always edge sensitive. the edge polarity can be configured us- ing the esb bit in the ior register. in edge-sensitive mode, a latch is set when a edge occurs on the interrupt source line and is cleared when the associated interrupt routine is started. so, an interrupt request can be stored until com- pletion of the currently executing interrupt routine, before being processed. if several interrupt re- quests occurs before completion of the current in- terrupt routine, only the first request is stored. storing of interrupt requests is not possible in level sensitive mode. to be taken into account, the low level must be present on the interrupt pin when the mcu samples the line after instruction execution. 6.5.1 notes on using external interrupts esb bit spurious interrupt on vector #2 if a pin associated with interrupt vector #2 is con- figured as interrupt with pull-up, whenever vector #2 is configured to be rising edge sensitive (by set- ting the esb bit in the ior register), an interrupt is latched although a rising edge may not have oc- cured on the associated pin. this is due to the vector #2 circuitry.the worka- round is to discard this first interrupt request in the routine (using a flag for example). masking of one interrupt by another on vector #2. when two or more port pins (associated with inter- rupt vector #2) are configured together as input with interrupt (falling edge sensitive), as long as one pin is stuck at '0', the other pin can never gen- erate an interrupt even if an active edge occurs at this pin. the same thing occurs when one pin is stuck at '1' and interrupt vector #2 is configured as rising edge sensitive. to avoid this the first pin must input a signal that goes back up to '1' right after the falling edge. oth- erwise, in the interrupt routine for the first pin, de- activate the ainput with interrupto mode using the port control registers (ddr, or, dr). an active edge on another pin can then be latched. i/o port configuration spurious interrupt on vector #2 if a pin associated with interrupt vector #2 is in `in- put with pull-up' state, a `0' level is present on the pin and the esb bit = 0, when the i/o pin is config- ured as interrupt with pull-up by writing to the ddrx, orx and drx register bits, an interrupt is latched although a falling edge may not have oc- curred on the associated pin. in the opposite case, if the pin is in interrupt with pull-up state , a 0 level is present on the pin and the esb bit =1, when the i/o port is configured as input with pull-up by writing to the ddrx, orx and drx bits, an interrupt is latched although a rising edge may not have occurred on the associated pin. 1
ST6208C/st6209c/st6210c/st6220c 30/105 6.6 interrupt handling procedure the interrupt procedure is very similar to a call pro- cedure, in fact the user can consider the interrupt as an asynchronous call procedure. as this is an asynchronous event, the user cannot know the context and the time at which it occurred. as a re- sult, the user should save all data space registers which may be used within the interrupt routines. the following list summarizes the interrupt proce- dure: when an interrupt request occurs, the following actions are performed by the mcu automatically: the core switches from the normal flags to the interrupt flags (or the nmi flags). the pc contents are stored in the top level of the stack. the normal interrupt lines are inhibited (nmi still active). the internal latch (if any) is cleared. theassociated interrupt vectoris loaded inthe pc. when an interrupt request occurs, the following actions must be performed by the user software: user selected registers have to be saved within the interrupt service routine (normally on a soft- ware stack). the source of the interrupt must be determined by polling the interrupt flags (if more than one source is associated with the same vector). the reti (return from interrupt) instruction must end the interrupt service routine. after the reti instruction is executed, the mcu re- turns to the main routine. caution: when a maskable interrupt occurs while the st6 core is in normal mode and during the execution of an aldi ior, 00ho instruction (disabling all maskable interrupts): if the interrupt request oc- curs during the first 3 cycles of the aldio instruction (which is a 4-cycle instruction) the core will switch to interrupt mode but the flags cn and zn will not switch to the interrupt pair ci and zi. 6.6.1 interrupt response time this is defined as the time between the moment when the program counter is loaded with the in- terrupt vector and when the program has jump to the interrupt subroutine and is ready to execute the code. it depends on when the interrupt occurs while the core is processing an instruction. figure 18. interrupt processing flow chart table 7. interrupt response time one cpu cycle is 13 external clock cycles thus 11 cpu cycles = 11 x (13 /8m) = 17.875 m s with an 8 mhz external quartz. minimum 6 cpu cycles maximum 11 cpu cycles instruction fetch instruction execute instruction was the instruction a reti? enable maskable interrupts select normal flags apopo the stacked pc is there an an interrupt request and interrupt mask? select interrupt flags push the pc into the stack load pc from interrupt vector disable maskable interrupt no no yes is the core already in normal mode? yes no yes clear internal latch *) *) if a latch is present on the interrupt source line 1
ST6208C/st6209c/st6210c/st6220c 31/105 6.7 register description interrupt option register (ior) address: 0c8h e write only reset status: 00h caution: this register is write-only and cannot be accessed by single-bit operations (set, res, dec,...). bit 7 =reserved, must be cleared. bit 6 = les level/edge selection bit . 0: falling edge sensitive mode is selected for inter- rupt vector #1 1: low level sensitive mode is selected for inter- rupt vector #1 bit 5 = esb edge selection bit . 0: falling edge mode on interrupt vector #2 1: rising edge mode on interrupt vector #2 bit 4 = gen global enable interrupt . 0: disable all maskable interrupts 1: enable all maskable interrupts note: when the gen bit is cleared, the nmi inter- rupt is active but cannot be used to exit from stop or wait modes. bits 3:0 = reserved, must be cleared. table 8. interrupt mapping * depending on device. see device summary on page 1. 70 - les esb gen - - - - vector number source block description register label flag exit from stop vector address priority order reset reset n/a n/a yes ffeh-fffh vector #0 nmi non maskable interrupt n/a n/a yes ffch-ffdh not used ffah-ffb h ff8h-ff9h vector #1 port a ext. interrupt port a n/a n/a yes ff6h-ff7h vector #2 port b ext. interrupt port b n/a n/a yes ff4h-ff5h vector #3 timer timer underflow tscr tmz yes ff2h-ff3h vector #4 adc* end of conversion adcr eoc no ff0h-ff1h priority lowest highest priority 1
ST6208C/st6209c/st6210c/st6220c 32/105 7 power saving modes 7.1 introduction to give a large measure of flexibility to the applica- tion in terms of power consumption, two main pow- er saving modes are implemented in the st6 (see figure 19). in addition, the low frequency auxiliary oscillator (lfao) can be used instead of the main oscillator to reduce power consumption in run and wait modes. after a reset the normal operating mode is se- lected by default (run mode). this mode drives the device (cpu and embedded peripherals) by means of a master clock which is based on the main oscillator frequency. from run mode, the different power saving modes may be selected by calling the specific st6 software instruction or for the lfao by setting the relevant register bit. for more information on the lfao, please refer to the clock chapter. figure 19. power saving mode transitions power consumption wait lfao run stop high low 1
ST6208C/st6209c/st6210c/st6220c 33/105 7.2 wait mode the mcu goes into wait mode as soon as the wait instruction is executed. this has the follow- ing effects: program execution is stopped, the microcontrol- ler software can be considered as being in a afro- zeno state. ram contents and peripheral registers are pre- served as long as the power supply voltage is higher than the ram retention voltage. the oscillator is kept running to provide a clock to the peripherals; they are still active. wait mode can be used when the user wants to reduce the mcu power consumption during idle periods, while not losing track of time or the ability to monitor external events. wait mode places the mcu in a low power consumption mode by stop- ping the cpu. the active oscillator (main oscillator or lfao) is kept running in order to provide a clock signal to the peripherals. if the power consumption has to be further re- duced, the low frequency auxiliary oscillator (lfao) can be used in place of the main oscillator, if its operating frequency is lower. if required, the lfao must be switched on before entering wait mode. exit from wait mode the mcu remains in wait mode until one of the following events occurs: reset (watchdog, lvd or reset pin) a peripheral interrupt (timer, adc,...), an external interrupt (i/o port, nmi) the program counter then branches to the start- ing address of the interrupt or reset service rou- tine. refer to figure 20. note : it should be noted that when the gen bit in the ior register is low (interrupts disabled), the nmi interrupt is active but cannot cause a wake up from stop/wait modes. figure 20. wait mode flow-chart wait instruction rese t interrupt y n n y clock to cpu oscillator clock to peripherals on yes no fetch reset vector or serv ice interrupt 2048 clock cycle delay clock to cpu oscillator clock to peripherals restart yes yes clock to cpu oscillator clock to peripherals on yes yes 1
ST6208C/st6209c/st6210c/st6220c 34/105 7.3 stop mode stop mode is the lowest power consumption mode of the mcu (see figure 22). the mcu goes into stop mode as soon as the stop instruction is executed. this has the follow- ing effects: program execution is stopped, the microcontrol- ler can be considered as being afrozeno. the contents of ram and the peripheral regis- ters are kept safely as long as the power supply voltage is higher than the ram retention voltage. the oscillator is stopped, so peripherals cannot work except the those that can be driven by an external clock. exit from stop mode the mcu remains in stop mode until one of the following events occurs: reset (watchdog, lvd or reset pin) a peripheral interrupt (assuming this peripheral can be driven by an external clock) an external interrupt (i/o port, nmi) in all cases a delay of 2048 clock cycles (f int )is generated to make sure the oscillator has started properly. the program counter then points to the starting address of the interrupt or reset service routine (see figure 21). stop mode and watchdog when the watchdog is active (hardware or soft- ware activation), the stop instruction is disabled and a wait instruction will be executed in its place unless the exctnl option bit is set to 1 in the op- tion bytes and a a high level is present on the nmi pin. in this case, the stop instruction will be exe- cuted and the watchdog will be frozen. figure 21. stop mode timing overview stop run run 2048 clock cycle delay reset or interrupt stop instruction fetch vector 1
ST6208C/st6209c/st6210c/st6220c 35/105 stop mode (cont'd) figure 22. stop mode flow-chart notes: 1. exctnl is an option bit. see option byte section for more details. 2. peripheral clocked with an external clock source can still be active. 3. only some specific interrupts can exit the mcu from stop mode (such as external interrupt). refer to the interrupt mapping table for more details. stop instruction reset interrupt 3) y n n y fetch reset vector or service interrupt watchdog enable disable exctnl 1 1 level on nmi pin 0 0 reset interrupt n n y y value 1) clock to cpu oscillator clock to peripherals 2) off no no 2048 clock cycle delay clock to cpu oscillator clock to peripherals restart yes yes clock to cpu oscillator clock to peripherals on yes yes clock to cpu oscillator clock to peripherals on yes no 1
ST6208C/st6209c/st6210c/st6220c 36/105 7.4 notes related to wait and stop modes 7.4.1 exit from wait and stop modes 7.4.1.1 nmi interrupt it should be noted that when the gen bit in the ior register is low (interrupts disabled), the nmi interrupt is active but cannot cause a wake up from stop/wait modes. 7.4.1.2 restart sequence when the mcu exits from wait or stop mode, it should be noted that the restart sequence de- pends on the original state of the mcu (normal, in- terrupt or non-maskable interrupt mode) prior to entering wait or stop mode, as well as on the interrupt type. normal mode. if the mcu was in the main routine when the wait or stop instruction was execut- ed, exit from stop or wait mode will occur as soon as an interrupt occurs; the related interrupt routine is executed and, on completion, the instruction which follows the stop or wait instruction is then executed, providing no other interrupts are pending. non maskable interrupt mode. if the stop or wait instruction has been executed during execu- tion of the non-maskable interrupt routine, the mcu exits from stop or wait mode as soon as an interrupt occurs: the instruction which follows the stop or wait instruction is executed, and the mcu remains in non-maskable interrupt mode, even if another interrupt has been generated. normal interrupt mode. if the mcu was in inter- rupt mode before the stop or wait instruction was executed, it exits from stop or wait mode as soon as an interrupt occurs. nevertheless, two cases must be considered: if the interrupt is a normal one, the interrupt rou- tine in which the wait or stop mode was en- tered will be completed, starting with the execution of the instruction which follows the stop or the wait instruction, and the mcu is still in interrupt mode. at the end of this routine pending interrupts will be serviced according to their priority. in the event of a non-maskable interrupt, the non-maskable interrupt service routine is proc- essed first, then the routine in which the wait or stop mode was entered will be completed by executing the instruction following the stop or wait instruction. the mcu remains in normal in- terrupt mode. 7.4.2 recommended mcu configuration for lowest power consumption during run or wait modes, the user software must configure the mcu as follows: configure unused i/os as inputs without pull-up (these should be externally tied to well-defined logic levels) place all peripherals in their power down modes before entering stop mode select the low frequency auxiliary oscillator (provided this runs at a lower frequency than the main oscillator). the wait and stop instructions are not execut- ed if an enabled interrupt request is pending. 1
ST6208C/st6209c/st6210c/st6220c 37/105 8 i/o ports 8.1 introduction each i/o port contains up to 8 pins. each pin can be programmed independently as digital input (with or without pull-up and interrupt generation), digital output (open drain, push-pull) or analog in- put (when available). the i/o pins can be used in either standard or al- ternate function mode. standard i/o mode is used for: transfer of data through digital inputs and out- puts (on specific pins): external interrupt generation alternate function mode is used for: alternate signal input/output for the on-chip peripherals the generic i/o block diagram is shown in figure 23. 8.2 functional description each port is associated with 3 registers located in data space: data register (dr) data direction register (ddr) option register (or) each i/o pin may be programmed using the corre- sponding register bits in the ddr, dr and or reg- isters: bit x corresponding to pin x of the port. table 9 illustrates the various port configurations which can be selected by user software. during mcu initialization, all i/o registers are cleared and the input mode with pull-up and no in- terrupt generation is selected for all the pins, thus avoiding pin conflicts. 8.2.1 digital input modes the input configuration is selected by clearing the corresponding ddr register bit. in this case, reading the dr register returns the digital value applied to the external i/o pin. different input modes can be selected by software through the dr and or registers, see table 9. external interrupt function all input lines can be individually connected by software to the interrupt system by programming the or and dr registers accordingly. the inter- rupt trigger modes (falling edge, rising edge and low level) can be configured by software for each port as described in the interrupt chapter. 8.2.2 analog inputs some pins can be configured as analog inputs by programming the or and dr registers according- ly, see table 9. these analog inputs are connect- ed to the on-chip 8-bit analog to digital converter. warning: only one pin should be programmed as an analog input at any time, since by selecting more than one input simultaneously their pins will be effectively shorted. 8.2.3 output modes the output configuration is selected by setting the corresponding ddr register bit. in this case, writ- ing to the dr register applies this digital value to the i/o pin through the latch. then, reading the dr register returns the previously stored value. two different output modes can be selected by software through the or register: push-pull and open-drain. dr register value and output pin status: note : the open drain setting is not a true open drain. this means it has the same structure as the push-pull setting but the p-buffer is deactivated. 8.2.4 alternate functions when an on-chip peripheral is configured to use a pin, the alternate function (timer input/output...) is not systematically selected but has to be config- ured through the ddr, or and dr registers. re- fer to the chapter describing the peripheral for more details. dr push-pu ll open-drain 0v ss v ss 1v dd floating 1
ST6208C/st6209c/st6210c/st6220c 38/105 i/o ports (cont'd) figure 23. i/o port block diagram table 9. i/o port configurations note: x = don't care ddr or dr mode optio n 0 0 0 input with pull-up, no interrupt 0 0 1 input no pull-up, no interrupt 0 1 0 input with pull-up and with interrupt 0 1 1 input analog input (when available) 1 0 x output open-drain output (20ma sink when available) 1 1 x output push-pull output (20ma sink when available) v dd reset st6 internal data data direction register register option register to interrupt v dd to adc v dd n-buffer p-buffer pull-up cmos schmitt trigger pxx i/o pin bus clamping diodes * * depending on device. see device summary on page 1 . 1
ST6208C/st6209c/st6210c/st6220c 39/105 i/o ports (cont'd) 8.2.5 instructions not to be used to access port data registers (set, res, inc and dec) do not use single-bit instructions (set, res, inc and dec) on port data reg- isters if any pin of the port is config- ured in input mode. these instructions make an implicit read and write back of the entire register. in port input mode, however, the data register reads from the input pins directly, and not from the data register latch- es. since data register information in input mode is used to set the characteristics of the input pin (in- terrupt, pull-up, analog input), these may be unin- tentionally reprogrammed depending on the state of the input pins. as a general rule, it is better to only use single bit instructions on data registers when the whole (8- bit) port is in output mode. in the case of inputs or of mixed inputs and outputs, it is advisable to keep a copy of the data register in ram. single bit in- structions may then be used on the ram copy, af- ter which the whole copy register can be written to the port data register: set bit, datacopy ld a, datacopy ld dra, a 8.2.6 recommendations 1. safe i/o state switching sequence switching the i/o ports from one state to another should be done in a sequence which ensures that no unwanted side effects can occur. the recom- mended safe transitions are illustrated in figure 24 all other transitions are potentially risky and should be avoided when changing the i/o operat- ing mode. 2. handling unused port bits on ports that have less than 8 external pins con- nected: leave the unbonded pins in reset state and do not change their configuration. do not use instructions that act on a whole port register (inc, dec, or read operations). unavail- able bits must be masked by software (and in- struction). thus, when a read operation performed on an incomplete port is followed by a comparison, use a mask. 3. high impedance input on any cmos device, it is not recommended to connect high impedance on input pins. the choice of these impedance has to be done with respect to the maximum leakage current defined in the da- tasheet. the risk is to be close or out of specifica- tion on the input levels applied to the device. 8.3 low power modes the wait and stop instructions allow the st62xx to be used in situations where low power consumption is needed. the lowest power con- sumption is achieved by configuring i/os in output push-pull low mode. 8.4 interrupts the external interrupt event generates an interrupt if the corresponding configuration is selected with ddr, dr and or registers (see table 9) and the gen-bit in the ior register is set. figure 24. diagram showing safe i/o state transitions note *. xxx = ddr, or, dr bits respectively mode description wait no effect on i/o ports. external interrupts cause the device to exit from wait mode. stop no effect on i/o ports. external interrupts cause the device to exit from stop mode. interrupt pull-up output open drain output push-pull input pull-up (reset state) input analog output open drain output push-pull input 010* 000 100 110 011 001 101 111 1
ST6208C/st6209c/st6210c/st6220c 40/105 i/o ports (cont'd) table 10. i/o port option selections note 1 . provided the correct configuration has been selected (see table 9). mode available on (1) schematic digital input input pa0-pa3 pb0-pb7 ddrx 0 orx 0 drx 1 reset state input with pull up pa0-pa3 pb0-pb7 ddrx 0 orx 0 drx 0 input with pull up with interrupt pa0-pa3 pb0-pb7 ddrx 0 orx 1 drx 0 analog input analog input pb0-pb3 (st6210c/20c) pb4-pb7 (except ST6208C) ddrx 0 orx 1 drx 1 digital output open drain output (5ma) open drain output (20 ma) pb0-pb7 pa0-pa3 ddrx 1 orx 0 drx 0/1 push-pull output (5ma) push-pull output (20 ma) pb0-pb7 pa0-pa3 ddrx 1 orx 1 drx 0/1 data in interrupt v dd v dd data in interrupt v dd v dd data in interrupt v dd v dd adc v dd data out p-buffer disconnected v dd data out v dd 1
ST6208C/st6209c/st6210c/st6220c 41/105 i/o ports (cont'd) 8.5 register description data register (dr) port x data register drx with x = a or b. read/write reset value: 0000 0000 (00h) bits 7:0 = d[7:0] data register bits. reading the dr register returns either the dr reg- ister latch content (pin configured as output) or the digital value applied to the i/o pin (pin configured as input). caution: in input mode, modifying this register will modify the i/o port configuration (see table 9). do not use the single bit instructions on i/o port data registers. see (section 8.2.5). data direction register (ddr) port x data direction register ddrx with x = a or b. read/write reset value: 0000 0000 (00h) bits 7:0 = dd[7:0] data direction register bits. the ddr register gives the input/output direction configuration of the pins. each bit is set and cleared by software. 0: input mode 1: output mode option register (or) port x option register orx with x = a or b. read/write reset value: 0000 0000 (00h) bits 7:0 = o[7:0] option register bits. the or register allows to distinguish in output mode if the push-pull or open drain configuration is selected. output mode: 0: open drain output(with p-buffer deactivated) 1: push-pull output input mode: see table 9. each bit is set and cleared by software. caution: modifying this register, will also modify the i/o port configuration in input mode. (see ta- ble 9). table 11. i/o port register map and reset values 70 d7 d6 d5 d4 d3 d2 d1 d0 70 dd7 dd6 dd5 dd4 dd3 dd2 dd1 dd0 70 o7 o6 o5 o4 o3 o2 o1 o0 address (hex.) register label 76543210 reset value of all i/o port registers 00000000 0c0h dra msb lsb 0c1h drb 0c4h ddra msb lsb 0c5h ddrb 0cch ora msb lsb 0cdh orb 1
ST6208C/st6209c/st6210c/st6220c 42/105 9 on-chip peripherals 9.1 watchdog timer (wdg) 9.1.1 introduction the watchdog timer is used to detect the occur- rence of a software fault, usually generated by ex- ternal interference or by unforeseen logical condi- tions, which causes the application program to abandon its normal sequence. the watchdog cir- cuit generates an mcu reset on expiry of a pro- grammed time period, unless the program refresh- es the counter's contents before the sr bit be- comes cleared. 9.1.2 main features n programmable timer (64 steps of 3072 clock cycles) n software reset n reset (if watchdog activated) when the sr bit reaches zero n hardware or software watchdog activation selectable by option bit (refer to the option bytes section) figure 25. watchdog block diagram reset c 7-bit downcounter f int /12 sr t0 clock divider watchdog register (wdgr) 256 t1 t2 t3 t4 t5 bit 0 bit 7 1
ST6208C/st6209c/st6210c/st6220c 43/105 watchdog timer (cont'd) 9.1.3 functional description the watchdog activation is selected through an option in the option bytes: hardware watchdog option after reset, the watchdog is permanently active, the c bit in the wdgr is forced high and the user can not change it. however, this bit can be read equally as 0 or 1. software watchdog option after reset, the watchdog is deactivated. the func- tion is activated by setting c bit in the wdgr reg- ister. once activated, it cannot be deactivated. the counter value stored in the wdgr register (bits sr:t0), is decremented every 3072 clock cy- cles. the length of the timeout period can be pro- grammed by the user in 64 steps of 3072 clock cy- cles. if the watchdog is activated (by setting the c bit) and when the sr bit is cleared, the watchdog initi- ates a reset cycle pulling the reset pin low for typi- cally 500ns. the application program must write in the wdgr register at regular intervals during normal opera- tion to prevent an mcu reset. the value to be stored in the wdgr register must be between feh and 02h (see table 12). to run the watchdog function the following conditions must be true: the c bit is set (watchdog activated) the sr bit is set to prevent generating an imme- diate reset the t[5:0] bits contain the number of decre- ments which represent the time delay before the watchdog produces a reset. table 12. watchdog timing (f osc = 8 mhz) 9.1.3.1 software reset the sr bit can be used to generate a software re- set by clearing the sr bit while the c bit is set. 9.1.4 recommendations 1. the watchdog plays an important supporting role in the high noise immunity of st62xx devices, and should be used wherever possible. watchdog related options should be selected on the basis of a trade-off between application security and stop mode availability (refer to the description of the wdact and extcntl bits on the option bytes). when stop mode is not required, hardware acti- vation without external stop mode con- trol should be preferred, as it provides maxi- mum security, especially during power-on. when stop mode is required, hardware activa- tion and external stop mode control should be chosen. nmi should be high by default, to allow stop mode to be entered when the mcu is idle. the nmi pin can be connected to an i/o line (see figure 26) to allow its state to be controlled by soft- ware. the i/o line can then be used to keep nmi low while watchdog protection is required, or to avoid noise or key bounce. when no more processing is required, the i/o line is released and the device placed in stop mode for lowest power consumption. figure 26. a typical circuit making use of the exernal stop mode control feature 2. when software activation is selected (wdact bit in option byte) and the watchdog is not activat- ed, the downcounter may be used as a simple 7- bit timer (remember that the bits are in reverse or- der). the software activation option should be chosen only when the watchdog counter is to be used as a timer. to ensure the watchdog has not been un- expectedly activated, the following instructions should be executed: jrr 0, wdgr, #+3 ; if c=0,jump to next ldi wdgr, 0fdh ; sr=0 -> reset next : wdgr register initial value wdg timeout period (ms) max. feh 24.576 min. 02h 0.384 nmi switch i/o vr02002 1
ST6208C/st6209c/st6210c/st6220c 44/105 watchdog timer (cont'd) these instructions test the c bit and reset the mcu (i.e. disable the watchdog) if the bit is set (i.e. if the watchdog is active), thus disabling the watchdog. for more information on the use of the watchdog, please read application note an1015. note: this note applies only when the watchdog is used as a standard timer. it is recommended to read the counter twice, as it may sometimes return an invalid value if the read is performed while the counter is decremented (counter bits in transient state). to validate the return value, both values read must be equal. the counter decrements eve- ry 384 m s at 8mhz f osc . 9.1.5 low power modes 9.1.6 interrupts none. mode description wait no effect on watchdog. stop behaviour depends on the extcntl option in the option bytes: 1. watchdog disabled: the mcu will enter stop mode if a stop instruction is executed. 2. watchdog enabled and extcntl optio n disabled: if a stop instruction is encountered, it is interpreted as a wait. 3. watchdog and extcntl option enabled: if a stop instruction is encountered when the nmi pin is low, it is interpreted as a wait. if, however, the stop instruction is encountered when the nmi pin is high, the watchdog counter is frozen and the cpu en- ters stop mode. when the mcu exits stop mode (i.e. when an interrupt is generated), the watchdog resumes its activity. 1
ST6208C/st6209c/st6210c/st6220c 45/105 watchdog timer (cont'd) 9.1.7 register description watchdog register (wdgr) address: 0d8h - read/write reset value: 1111 1110 (feh) bit 0= c watchdog control bit . if the hardware option is selected (wdact bit in option byte), this bit is forced high and cannot be changed by the user (the watchdog is always ac- tive). when the software option is selected (wdact bit in option byte), the watchdog func- tion is activated by setting the c bit, and cannot then be deactivated (except by resetting the mcu). when c is kept cleared the counter can be used as a 7-bit timer. 0: watchdog deactivated 1: watchdog activated bit 1 = sr : software reset bit software can generate a reset by clearing this bit while the c bit is set. when c = 0 (watchdog de- activated) the sr bit is the msb of the 7-bit timer. 0: generate (write) 1: no software reset generated, msb of 7-bit timer bit 5:0 = t[5:0] downcounter bits caution: these bits are reversed and shifted with respect to the physical counter: bit-7 (t0) is the lsb of the watchdog downcounter and bit-2 (t5) is the msb. 70 t0 t1 t2 t3 t4 t5 sr c 1
ST6208C/st6209c/st6210c/st6220c 46/105 9.2 8-bit timer 9.2.1 introduction the 8-bit timer on-chip peripheral is a free run- ning downcounter based on an 8-bit downcounter with a 7-bit programmable prescaler, giving a max- imum count of 2 15 . the peripheral may be config- ured in three different operating modes. 9.2.2 main features n time-out downcounting mode with up to 15-bit accuracy n external counter clock source (valid also in stop mode) n interrupt capability on counter underflow n output signal generation n external pulse length measurement n event counter the timer can be used in wait and stop modes to wake up the mcu. figure 27. timer block diagram inte rrupt tmz eti tout dout psi ps2 ps1 ps0 tscr programmable prescaler pscr6 pscr5 pscr4 pscr3 pscr2 pscr1 pscr0 pscr register 0 70 tcr7 tcr6 tcr5 tcr4 tcr3 tcr2 tcr1 tcr0 tcr 70 reload 8-bit down counte r timer f prescaler f counter f ext f int/12 latch pin pscr7 7 /2 /1 /4 /8 /16 /32 /64 /128 regist er register 1
ST6208C/st6209c/st6210c/st6220c 47/105 8-bit timer (cont'd) 9.2.3 counter/prescaler description prescaler the prescaler input can be the internal frequency f int divided by 12 or an external clock applied to the timer pin. the prescaler decrements on the rising edge, depending on the division factor pro- grammed by the ps[2:0] bits in the tscr register. the state of the 7-bit prescaler can be read in the pscr register. when the prescaler reaches 0, it is automatically reloaded with 7fh. counter the free running 8-bit downcounter is fed by the output of the programmable prescaler, and is dec- remented on every rising edge of the f counter clock signal coming from the prescaler. it is possible to read or write the contents of the counter on the fly, by reading or writing the timer counter register (tcr). when the downcounter reaches 0, it is automati- cally reloaded with the value 0ffh. counter clock and prescaler the counter clock frequency is given by: f counter =f prescaler /2 ps[2:0] where f prescaler can be: f int /12 f ext (input on timer pin) f int /12 gated by timer pin the timer input clock feeds the 7-bit programma- ble prescaler. the prescaler output can be pro- grammed by selecting one of the 8 available pres- caler taps using the ps[2:0] bits in the status/con- trol register (tscr). thus the division factor of the prescaler can be set to 2 n (where n equals 0, to 7). see figure 27. the clock input is enabled by the psi (prescaler initialize) bit in the tscr register. when psi is re- set, the counter is frozen and the prescaler is load- ed with the value 7fh. when psi is set, the pres- caler and the counter run at the rate of the select- ed clock source. counter and prescaler initialization after reset, the counter and the prescaler are in- itialized to 0ffh and 7fh respectively. the 7-bit prescaler can be initialized to 7fh by clearing the psi bit. direct write access to the prescaler is also possible when psi =1. then, any value between 0 and 7fh can be loaded into it. the 8-bit counter can be initialized separately by writing to the tcr register. 9.2.3.1 8-bit counting and interrupt capability on counter underflow whatever the division factor defined for the pres- caler, the timer counter works as an 8-bit down- counter. the input clock frequency is user selecta- ble using the ps[2:0] bits. when the downcounter decrements to zero, the tmz (timer zero) bit in the tscr is set. if the eti (enable timer interrupt) bit in the tscr is also set, an interrupt request is generated. the timer interrupt can be used to exit the mcu from wait or stop mode. the tcr can be written at any time by software to define a time period ending with an underflow event, and therefore manage delay or timer func- tions. tmz is set when the downcounter reaches zero; however, it may also be set by writing 00h in the tcr register or by setting bit 7 of the tscr register. the tmz bit must be cleared by user software when servicing the timer interrupt to avoid unde- sired interrupts when leaving the interrupt service routine. note : a write to the tcr register will predominate over the 8-bit counter decrement to 00h function, i.e. if a write and a tcr register decrement to 00h occur simultaneously, the write will take prece- dence, and the tmz bit is not set until the 8-bit counter underflows again. 1
ST6208C/st6209c/st6210c/st6220c 48/105 8-bit timer (cont'd) 9.2.4 functional description there are three operating modes, which are se- lected by the tout and dout bits (see tscr register). these three modes correspond to the two clocks which can be connected to the 7-bit prescaler (f int 12 or timer pin signal), and to the output mode. the settings for the different operating modes are summarized table 13. table 13. timer operating modes 9.2.4.1 gated mode (tout = a0o, dout = a1o) in this mode, the prescaler is decremented by the timer clock input, but only when the signal on the timer pin is held high (f int /12 gated by timer pin). see figure 28 and figure 29. this mode is selected by clearing the tout bit in the tscr register (i.e. as input) and setting the dout bit. note: in this mode, if the timer pin is multi- plexed, the corresponding port control bits have to be set in input with pull-up configuration through the ddr, or and dr registers. for more details, please refer to the i/o ports section. figure 28. f timer clock in gated mode figure 29. gated mode operation tout dout timer function application 00 event counter (input) external counter clock source 01 gated input (input) external pulse length measurement 10 output a0o (output) output signal 11 output a1o (output) generation f prescaler timer f int /12 f ext xx1 1 counte r value timer pin timer clock value 1 value 2 pulse length xx2 1
ST6208C/st6209c/st6210c/st6220c 49/105 8-bit timer (cont'd) 9.2.4.2 event counter mode (tout = a0o, dout = a0o) in this mode, the timer pin is the input clock of the timer prescaler which is decremented on eve- ry rising edge of the input clock (allowing event count). see figure 30 and figure 31. this mode is selected by clearing the tout bit in the tscr register (i.e. as input) and clearing the dout bit. note: in this mode, if the timer pin is multi- plexed, the corresponding port control bits have to be set in input with pull-up configuration. figure 30. f timer clock in event counter mode figure 31. event counter mode operation 9.2.4.3 output mode (tout = a1o, dout = adata outo) in output mode, the timer pin is connected to the dout latch, hence the timer prescaler is clocked by theprescaler clock input (f int /12). see figure32. the user can select the prescaler division ratio us- ing the ps[2:0] bits in the tscr register. when tcr decrements to zero, it sets the tmz bit in the tscr. the tmz bit can be tested under program control to perform a timer function whenever it goes high and has to be cleared by the user. the low-to-high tmz bit transition is used to latch the dout bit in the tscr and, if the tout bit is set, dout is transferred to the timer pin. this oper- ating mode allows external signal generation on the timer pin. see figure 33. this mode is selected by setting the tout bit in the tscr register (i.e. as output) and setting the dout bit to output a high level or clearing the dout bit to output a low level. note: as soon as the tout bit is set, the timer pin is configured as output push-pull regardless of the corresponding i/o port control registers setting (if the timer pin is multiplexed). figure 32. output mode control figure 33. output mode operation f prescaler timer xx1 counter value timer pin value 1 value 2 xx2 tmz timer tout dout latch ffh 1 counter timer pin 1 st downcount: default output value is 0 at each zero event dout has to be copied to the timer pin 1
ST6208C/st6209c/st6210c/st6220c 50/105 8-bit timer (cont'd) 9.2.5 low power modes 9.2.6 interrupts mode description wait no effect on timer. timer interrupt events cause the device to exit from wait mode. stop timer registers are frozen except in event counter mode (with external clock on tim- er pin). interrupt event event flag enable bit exit from wait exit from stop timer zero event tmz eti yes yes 1
ST6208C/st6209c/st6210c/st6220c 51/105 8-bit timer (cont'd) 9.2.7 register description prescaler counter register (pscr) address: 0d2h - read/write reset value: 0111 1111 (7fh) bit 7 = pscr7: not used, always read as a0o. bit 6:0 = pscr[6:0] prescaler lsb. timer counter register (tcr) address: 0d3h - read / write reset value: 1111 1111 (ffh) bit 7:0 = tcr[7:0] timer counter bits. timer status control register (tscr) address: 0d4h - read/write reset value: 0000 0000 (00h) bit 7 = tmz timer zero bit. a low-to-high transition indicates that the timer count register has underflowed. it means that the tcr value has changed from 00h to ffh. this bit must be cleared by user software. 0: counter has not underflowed 1: counter underflow occurred bit 6 = eti enable timer interrupt. when set, enables the timer interrupt request. if eti=0 the timer interrupt is disabled. if eti=1 and tmz=1 an interrupt request is generated. 0: interrupt disabled (reset state) 1: interrupt enabled bit 5 = tout timer output control . when low, this bit selects the input mode for the timer pin. when high the output mode is select- ed. 0: input mode (reset state) 1: output mode, the timer pin is configured as push-pull output bit 4= dout data output. data sent to the timer output when tmz is set high (output mode only). input mode selection (input mode only). bit 3 = psi : prescaler initialize bit. used to initialize the prescaler and inhibit its count- ing. when psi=a0o the prescaler is set to 7fh and the counter is inhibited. when psi=a1o the prescal- er is enabled to count downwards. as long as pse=a1o both counter and prescaler are not run- ning 0: counting disabled (reset state) 1: counting enabled bit 1:0 = ps[2:0] prescaler mux. select. these bits select the division ratio of the prescaler register. table 14. prescaler division factors table 15. 8-bit timer register map and reset values 70 pscr 7 pscr 6 pscr 5 pscr 4 pscr 3 pscr 2 pscr 1 pscr 0 70 tcr7 tcr6 tcr5 tcr4 tcr3 tcr2 tcr1 tcr0 70 tmz eti tout dout psi ps2 ps1 ps0 ps2 ps1 ps0 divided by 0001 0012 0104 0118 10016 10132 11064 1 1 1 128 address (hex.) register label 76543210 0d2h pscr reset value pscr7 0 pscr6 1 pscr5 1 pscr4 1 pscr3 1 pscr2 1 pscr1 1 pscr0 1 0d3h tcr reset value tcr7 1 tcr6 1 tcr5 1 tcr4 1 tcr3 1 tcr2 1 tcr1 1 tcr0 1 0d4h tscr reset value tmz 0 eti 0 tout 0 dout 0 psi 0 ps2 0 ps1 0 ps0 0 1
ST6208C/st6209c/st6210c/st6220c 52/105 9.3 a/d converter (adc) 9.3.1 introduction the on-chip analog to digital converter (adc) pe- ripheral is a 8-bit, successive approximation con- verter. this peripheral has multiplexed analog in- put channels (refer to device pin out description) that allow the peripheral to convert the analog volt- age levels from different sources. the result of the conversion is stored in a 8-bit data register. the a/d converter is controlled through a control register. 9.3.2 main features n 8-bit conversion n multiplexed analog input channels n linear successive approximation n data register (dr) which contains the results n end of conversion flag n on/off bit (to reduce consumption) n typical conversion time 70 m s (with an 8 mhz crystal) the block diagram is shown in figure 34. figure 34. adc block diagram note: adc not present on some devices. see device summary on page 1. osc d1 d3 eai eoc sta pds d0 adcr ain0 ain1 analog to digital converter ainx port mux d2 d1 d3 d7 d6 d5 d4 d0 adr div 12 f adc f int ddrx orx drx i/o port off 1
ST6208C/st6209c/st6210c/st6220c 53/105 a/d converter (cont'd) 9.3.3 functional description 9.3.3.1 analog power supply the high and low level reference voltage pins are internally connected to the v dd and v ss pins. conversion accuracy may therefore be impacted by voltage drops and noise in the event of heavily loaded or badly decoupled power supply lines. 9.3.3.2 digital a/d conversion result the conversion is monotonic, meaning that the re- sult never decreases if the analog input does not and never increases if the analog input does not. if the input voltage (v ain ) is greater than or equal to v dda (high-level voltage reference) then the conversion result in the dr register is ffh (full scale) without overflow indication. if input voltage (v ain ) is lower than or equal to v ssa (low-level voltage reference) then the con- version result in the dr register is 00h. the a/d converter is linear and the digital result of the conversion is stored in the adr register. the accuracy of the conversion is described in the par- ametric section. r ain is the maximum recommended impedance for an analog input signal. if the impedance is too high, this will result in a loss of accuracy due to leakage and sampling not being completed in the allocated time. refer to the electrical characteris- tics chapter for more details. with an oscillator clock frequency less than 1.2mhz, conversion accuracy is decreased. 9.3.3.3 analog input selection selection of the input pin is done by configuring the related i/o line as an analog input via the data direction, option and data registers (refer to i/o ports description for additional information). warning: only one i/o line must be configured as an analog input at any time. the user must avoid any situation in which more than one i/o pin is se- lected as an analog input simultaneously, because they will be shorted internally. 9.3.3.4 software procedure refer to the control register (adcr) and data reg- ister (adr) in section 9.3.7 for the bit definitions. analog input configuration the analog input must be configured through the port control registers (ddrx, orx and drx). re- fer to the i/o port chapter. adc configuration in the adcr register: reset the pds bit to power on the adc. this bit must be set at least one instruction before the beginning of the conversion to allow stabilisation of the a/d converter. set the eai bit to enable the adc interrupt if needed. adc conversion in the adcr register: set the sta bit to start a conversion. this auto- matically clears (resets to a0o) the end of con- version bit (eoc). when a conversion is complete the eoc bit is set by hardware to flag that con- version is complete and that the data in the adc data conversion register is valid. an interrupt is generated if the eai bit was set setting the sta bit will start a new count and will clear the eoc bit (thus clearing the interrupt con- dition) note: setting the sta bit must be done by a different in- struction from the instruction that powers-on the adc (setting the pds bit) in order to make sure the voltage to be converted is present on the pin. each conversion has to be separately initiated by writing to the sta bit. the sta bit is continuously scanned so that, if the user sets it to a1o while a previous conversion is in progress, a new conversion is started before com- pleting the previous one. the start bit (sta) is a write only bit, any attempt to read it will show a log- ical a0o. 1
ST6208C/st6209c/st6210c/st6220c 54/105 a/d converter (cont'd) 9.3.4 recommendations the following six notes provide additional informa- tion on using the a/d converter. 1.the a/d converter does not feature a sample and hold circuit. the analog voltage to be meas- ured should therefore be stable during the entire conversion cycle. voltage variation should not ex- ceed 1/2 lsb for optimum conversion accuracy. a low pass filter may be used at the analog input pins to reduce input voltage variation during con- version. 2. when selected as an analog channel, the input pin is internally connected to a capacitor c ad of typically 9pf. for maximum accuracy, this capaci- tor must be fully charged at the beginning of con- version. in the worst case, conversion starts one instruction (6.5 m s) after the channel has been se- lected. the impedance of the analog voltage source (asi) in worst case conditions, is calculat- ed using the following formula: 6.5 m s=9xc ad x asi (capacitor charged to over 99.9%), i.e. 30 k w in- cluding a 50% guardband. the asi can be higher if c ad has been charged for a longer period by adding instructions before the start of conversion (adding more than 26 cpu cy- cles is pointless). 3. since the adc is on the same chip as the micro- processor, the user should not switch heavily load- ed output signals during conversion, if high preci- sion is required. such switching will affect the sup- ply voltages used as analog references. 4. conversion accuracy depends on the quality of the power supplies (v dd and v ss ). the user must take special care to ensure a well regulated refer- ence voltage is present on the v dd and v ss pins (power supply voltage variations must be less than 0.1v/ms). this implies, in particular, that a suitable decoupling capacitor is used at the v dd pin. the converter resolution is given by: the input voltage (ain) which is to be converted must be constant for 1 m s before conversion and remain constant during conversion. 5. conversion resolution can be improved if the power supply voltage (v dd ) to the microcontroller is lowered. 6. in order to optimize the conversion resolution, the user can configure the microcontroller in wait mode, because this mode minimises noise distur- bances and power supply variations due to output switching. nevertheless, the wait instruction should be executed as soon as possible after the beginning of the conversion, because execution of the wait instruction may cause a small variation of the v dd voltage. the negative effect of this var- iation is minimized at the beginning of the conver- sion when the converter is less sensitive, rather than at the end of conversion, when the least sig- nificant bits are determined. the best configuration, from an accuracy stand- point, is wait mode with the timer stopped. in this case only the adc peripheral and the oscilla- tor are then still working. the mcu must be woken up from wait mode by the adc interrupt at the end of the conversion. the microcontroller can also be woken up by the timer interrupt, but this means the timer must be running and the result- ing noise could affect conversion accuracy. caution: when an i/o pin is used as an analog in- put, a/d conversion accuracy will be impaired if negative current injections (v inj ST6208C/st6209c/st6210c/st6220c 55/105 a/d converter (cont'd) 9.3.5 low power modes note : the a/d converter may be disabled by clear- ing the pds bit. this feature allows reduced power consumption when no conversion is needed. 9.3.6 interrupts note: the eoc bit is cleared only when a new conversion is started (it cannot be cleared by writ- ing 0). to avoid generating further eoc interrupt, the eai bit has to be cleared within the adc inter- rupt subroutine. 9.3.7 register description a/d converter control register (ad- cr) address: 0d0h - read/write (bit 6 read only, bit 5 write only) reset value: 01000 0000 (40h) bit 7 = eai enable a/d interrupt. 0: adc interrupt disabled 1: adc interrupt enabled bit 6 = eoc end of conversion. read only when a conversion has been completed, this bit is set by hardware and an interrupt request is gener- ated if the eai bit is set. the eoc bit is automati- cally cleared when the sta bit is set. data in the data conversion register are valid only when this bit is set to a1o. 0: conversion is not complete 1: conversion can be read from the dr register bit 5 = sta : start of conversion. write only . 0: no effect 1: start conversion note: setting this bit automatically clears the eoc bit. if the bit is set again when a conversion is in progress, the present conversion is stopped and a new one will take place. this bit is write only, any attempt to read it will show a logical zero. bit 4 = pds power down selection. 0: a/d converter is switched off 1: a/d converter is switched on bit 3 = d3 not used, must be kept cleared. bit 2 = oscoff main oscillator off. 0: main oscillator enabled 1: main oscillator disabled note: this bit does not apply to the adc peripher- al but to the main clock system. refer to the clock system section. bit 1:0 = d[1:0] not used, must be kept cleared. a/d converter data register (adr) address: 0d1h - read only reset value: xxh bit 7:0 = d[7:0] : 8 bit a/d conversion result. table 16. adc register map and reset values mode description wait no effect on a/d converter. adc interrupts cause the device to exit from wait mode. stop a/d converter disabled. interrupt event event flag enable bit exit from wait exit from stop end of conver- sion eoc eai yes no 70 eai eoc sta pds d3 osc off d1 d0 70 d7 d6 d5 d4 d3 d2 d1 d0 address (hex.) register label 76543210 0d0h adr reset value d7 0 d6 0 d5 0 d4 0 d3 0 d2 0 d1 0 d0 0 0d1h adcr reset value eai 0 eoc 1 sta 0 pds 0 d3 0 d2 0 d1 0 d0 0 1
ST6208C/st6209c/st6210c/st6220c 56/105 10 instruction set 10.1 st6 architecture the st6 architecture has been designed for max- imum efficiency while keeping byte usage to a minimum; in short, to provide byte-efficient pro- gramming. the st6 core has the ability to set or clear any register or ram location bit in data space using a single instruction. furthermore, pro- grams can branch to a selected address depend- ing on the status of any bit in data space. 10.2 addressing modes the st6 has nine addressing modes, which are described in the following paragraphs. three dif- ferent address spaces are available: program space, data space, and stack space. program space contains the instructions which are to be ex- ecuted, plus the data for immediate mode instruc- tions. data space contains the accumulator, the x, y, v and w registers, peripheral and input/output registers, the ram locations and data rom loca- tions (for storage of tables and constants). stack space contains six 12-bit ram cells used to stack the return addresses for subroutines and inter- rupts. immediate . in immediate addressing mode, the operand of the instruction follows the opcode loca- tion. as the operand is a rom byte, the immediate addressing mode is used to access constants which do not change during program execution (e.g., a constant used to initialize a loop counter). direct . in direct addressing mode, the address of the byte which is processed by the instruction is stored in the location which follows the opcode. di- rect addressing allows the user to directly address the 256 bytes in data space memory with a single two-byte instruction. short direct . the core can address the four ram registers x, y, v, w (locations 80h, 81h, 82h, 83h) in short-direct addressing mode. in this case, the instruction is only one byte and the selection of the location to be processed is contained in the op- code. short direct addressing is a subset of direct addressing mode. (note that 80h and 81h are also indirect registers). extended . in extended addressing mode, the 12- bit address needed to define the instruction is ob- tained by concatenating the four least significant bits of the opcode with the byte following the op- code. the instructions (jp, call) which use ex- tended addressing mode are able to branch to any address in the 4 kbyte program space. extended addressing mode instructions are two bytes long. program counter relative . relative addressing mode is only used in conditional branch instruc- tions. the instruction is used to perform a test and, if the condition is true, a branch with a span of -15 to +16 locations next to the address of the relative instruction. if the condition is not true, the instruc- tion which follows the relative instruction is execut- ed. relative addressing mode instructions are one byte long. the opcode is obtained by adding the three most significant bits which characterize the test condition, one bit which determines whether it is a forward branch (when it is 0) or backward branch (when it is 1) and the four least significant bits which give the span of the branch (0h to fh) which must be added or subtracted from the ad- dress of the relative instruction to obtain the branch destination address. bit direct . in bit direct addressing mode, the bit to be set or cleared is part of the opcode, and the byte following the opcode points to the address of the byte in which the specified bit must be set or cleared. thus, any bit in the 256 locations of data space memory can be set or cleared. bit test & branch . bit test and branch addressing mode is a combination of direct addressing and relative addressing. bit test and branch instruc- tions are three bytes long. the bit identification and the test condition are included in the opcode byte. the address of the byte to be tested is given in the next byte. the third byte is the jump dis- placement, which is in the range of -127 to +128. this displacement can be determined using a la- bel, which is converted by the assembler. indirect . in indirect addressing mode, the byte processed by the register-indirect instruction is at the address pointed to by the content of one of the indirect registers, x or y (80h, 81h). the indirect register is selected by bit 4 of the opcode. register indirect instructions are one byte long. inherent . in inherent addressing mode, all the in- formation necessary for executing the instruction is contained in the opcode. these instructions are one byte long. 1
ST6208C/st6209c/st6210c/st6220c 57/105 10.3 instruction set the st6 offers a set of 40 basic instructions which, when combined with nine addressing modes, yield 244 usable opcodes. they can be di- vided into six different types: load/store, arithme- tic/logic, conditional branch, control instructions, jump/call, and bit manipulation. the following par- agraphs describe the different types. all the instructions belonging to a given type are presented in individual tables. load & store . these instructions use one, two or three bytes depending on the addressing mode. for load, one operand is the accumulator and the other operand is obtained from data memory using one of the addressing modes. for load immediate, one operand can be any of the 256 data space bytes while the other is always immediate data. table 17. load & store instructions legend: x, y index registers, v, w short direct registers # immediate data (stored in rom memory) rr data space register d affected * not affected instruction addressing mode bytes cycles flags zc ld a, x short direct 1 4 d * ld a, y short direct 1 4 d * ld a, v short direct 1 4 d * ld a, w short direct 1 4 d * ld x, a short direct 1 4 d * ld y, a short direct 1 4 d * ld v, a short direct 1 4 d * ld w, a short direct 1 4 d * ld a, rr direct 2 4 d * ld rr, a direct 2 4 d * ld a, (x) indirect 1 4 d * ld a, (y) indirect 1 4 d * ld (x), a indirect 1 4 d * ld (y), a indirect 1 4 d * ldi a, #n immediate 2 4 d * ldi rr, #n immediate 3 4 * * 1
ST6208C/st6209c/st6210c/st6220c 58/105 instruction set (cont'd) arithmetic and logic . these instructions are used to perform arithmetic calculations and logic operations. in and, add, cp, sub instructions one operand is always the accumulator while, de- pending on the addressing mode, the other can be either a data space memory location or an imme- diate value. in clr, dec, inc instructions the op- erand can be any of the 256 data space address- es. in com, rlc, sla the operand is always the accumulator. table 18. arithmetic & logic instructions notes: x,y index registers v, w short direct registers d affected # immediate data (stored in rom memory) * not affected rr data space register instruction addressing mode bytes cycles flags zc add a, (x) indirect 1 4 dd add a, (y) indirect 1 4 dd add a, rr direct 2 4 dd addi a, #n immediate 2 4 dd and a, (x) indirect 1 4 dd and a, (y) indirect 1 4 dd and a, rr direct 2 4 dd andi a, #n immediate 2 4 dd clr a short direct 2 4 dd clr r direct 3 4 * * com a inherent 1 4 dd cp a, (x) indirect 1 4 dd cp a, (y) indirect 1 4 dd cp a, rr direct 2 4 dd cpi a, #n immediate 2 4 dd dec x short direct 1 4 d * dec y short direct 1 4 d * dec v short direct 1 4 d * dec w short direct 1 4 d * dec a direct 2 4 d * dec rr direct 2 4 d * dec (x) indirect 1 4 d * dec (y) indirect 1 4 d * inc x short direct 1 4 d * inc y short direct 1 4 d * inc v short direct 1 4 d * inc w short direct 1 4 d * inc a direct 2 4 d * inc rr direct 2 4 d * inc (x) indirect 1 4 d * inc (y) indirect 1 4 d * rlc a inherent 1 4 dd sla a inherent 2 4 dd sub a, (x) indirect 1 4 dd sub a, (y) indirect 1 4 dd sub a, rr direct 2 4 dd subi a, #n immediate 2 4 dd 1
ST6208C/st6209c/st6210c/st6220c 59/105 instruction set (cont'd) conditional branch . branch instructions perform a branch in the program when the selected condi- tion is met. bit manipulation instructions . these instruc- tions can handle any bit in data space memory. one group either sets or clears. the other group (see conditional branch) performs the bit test branch operations. control instructions . control instructions control microcontroller operations during program execu- tion. jump and call. these two instructions are used to perform long (12-bit) jumps or subroutine calls to any location in the whole program space. table 19. conditional branch instructions notes : b 3-bit address rr data space register e 5 bit signed displacement in the range -15 to +16 d affected. the tested bit is shifted into carry. ee 8 bit signed displacement in the range -126 to +129 * not affected table 20. bit manipulation instructions notes: b 3-bit address * not affected rr data space register bit manipulation instructions should not be used on port data registers and any registers with read only and/or write only bits (see i/o port chapter) table 21. control instructions notes: 1. this instruction is deactivated and a wait is automatically executed instead of a stop if the watchdog function is selected. d affected *not affected table 22. jump & call instructions notes: abc 12-bit address * not affected instruction branch if bytes cycles flags zc jrce c=1 1 2 * * jrnc e c = 0 1 2 * * jrze z=1 1 2 * * jrnz e z = 0 1 2 * * jrr b, rr, ee bit = 0 3 5 * d jrs b, rr, ee bit = 1 3 5 * d instruction addressing mode bytes cycles flags zc set b,rr bit direct 2 4 * * res b,rr bit direct 2 4 * * instruction addressing mode bytes cycles flags zc nop inherent 1 2 * * ret inherent 1 2 * * reti inherent 1 2 dd stop (1) inherent 1 2 * * wait inherent 1 2 * * instruction addressing mode bytes cycles flags zc call abc extended 2 4 * * jp abc extended 2 4 * * 1
ST6208C/st6209c/st6210c/st6220c 60/105 opcode map summary. the following table contains an opcode map for the instructions used by the st6 low 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 low hi hi 0 0000 2 jrnz 4 call 2 jrnc 5 jrr 2 jrz 2 jrc 4 ld 0 0000 e abc e b0,rr,ee e # e a,(x) 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 prc 1 ind 1 0001 2 jrnz 4 call 2 jrnc 5 jrs 2 jrz 4 inc 2 jrc 4 ldi 1 0001 e abc e b0,rr,ee e x e a,nn 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 sd 1 prc 2 imm 2 0010 2 jrnz 4 call 2 jrnc 5 jrr 2 jrz 2 jrc 4 cp 2 0010 e abc e b4,rr,ee e # e a,(x) 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 prc 1 ind 3 0011 2 jrnz 4 call 2 jrnc 5 jrs 2 jrz 4 ld 2 jrc 4 cpi 3 0011 e abc e b4,rr,ee e a,x e a,nn 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 sd 1 prc 2 imm 4 0100 2 jrnz 4 call 2 jrnc 5 jrr 2 jrz 2 jrc 4 add 4 0100 e abc e b2,rr,ee e # e a,(x) 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 prc 1 ind 5 0101 2 jrnz 4 call 2 jrnc 5 jrs 2 jrz 4 inc 2 jrc 4 addi 5 0101 e abc e b2,rr,ee e y e a,nn 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 sd 1 prc 2 imm 6 0110 2 jrnz 4 call 2 jrnc 5 jrr 2 jrz 2 jrc 4 inc 6 0110 e abc e b6,rr,ee e # e (x) 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 prc 1 ind 7 0111 2 jrnz 4 call 2 jrnc 5 jrs 2 jrz 4 ld 2 jrc 7 0111 e abc e b6,rr,ee e a,y e # 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 sd 1 prc 8 1000 2 jrnz 4 call 2 jrnc 5 jrr 2 jrz 2 jrc 4 ld 8 1000 e abc e b1,rr,ee e # e (x),a 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 prc 1 ind 9 1001 2 rnz 4 call 2 jrnc 5 jrs 2 jrz 4 inc 2 jrc 9 1001 e abc e b1,rr,ee e v e # 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 sd 1 prc a 1010 2 jrnz 4 call 2 jrnc 5 jrr 2 jrz 2 jrc 4 and a 1010 e abc e b5,rr,ee e # e a,(x) 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 prc 1 ind b 1011 2 jrnz 4 call 2 jrnc 5 jrs 2 jrz 4 ld 2 jrc 4 andi b 1011 e abc e b5,rr,ee e a,v e a,nn 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 sd 1 prc 2 imm c 1100 2 jrnz 4 call 2 jrnc 5 jrr 2 jrz 2 jrc 4 sub c 1100 e abc e b3,rr,ee e # e a,(x) 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 prc 1 ind d 1101 2 jrnz 4 call 2 jrnc 5 jrs 2 jrz 4 inc 2 jrc 4 subi d 1101 e abc e b3,rr,ee e w e a,nn 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 sd 1 prc 2 imm e 1110 2 jrnz 4 call 2 jrnc 5 jrr 2 jrz 2 jrc 4 dec e 1110 e abc e b7,rr,ee e # e (x) 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 prc 1 ind f 1111 2 jrnz 4 call 2 jrnc 5 jrs 2 jrz 4 ld 2 jrc f 1111 e abc e b7,rr,ee e a,w e # 1 pcr 2 ext 1 pcr 3 bt 1 pcr 1 sd 1 prc abbreviations for addressing modes: legend: dir direct # indicates ill egal instructions sd short direct e 5-bit displacement imm immediate b 3-bit address inh inherent rr 1-byte data space address ext extended nn 1-byte immediate data b.d bit direct abc 12-bit address bt bit test ee 8-bit displacement pcr program counter relative ind indirect 2 jrc e 1 prc mnemonic addressing mode bytes cycles operands 1
ST6208C/st6209c/st6210c/st6220c 61/105 opcode map summary (continued) low 8 1000 9 1001 a 1010 b 1011 c 1100 d 1101 e 1110 f 1111 low hi hi 0 0000 2 jrnz 4 jp 2 jrnc 4 res 2 jrz 4 ldi 2 jrc 4 ld 0 0000 e abc e b0,rr e rr,nn e a,(y) 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 3 imm 1 prc 1 ind 1 0001 2 jrnz 4 jp 2 jrnc 4 set 2 jrz 4 dec 2 jrc 4 ld 1 0001 e abc e b0,rr e x e a,rr 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 sd 1 prc 2 dir 2 0010 2 jrnz 4 jp 2 jrnc 4 res 2 jrz 4 com 2 jrc 4 cp 2 0010 e abc e b4,rr e a e a,(y) 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 prc 1 ind 3 0011 2 jrnz 4 jp 2 jrnc 4 set 2 jrz 4 ld 2 jrc 4 cp 3 0011 e abc e b4,rr e x,a e a,rr 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 sd 1 prc 2 dir 4 0100 2 jrnz 4 jp 2 jrnc 4 res 2 jrz 2 reti 2 jrc 4 add 4 0100 e abc e b2,rr e e a,(y) 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 inh 1 prc 1 ind 5 0101 2 jrnz 4 jp 2 jrnc 4 set 2 jrz 4 dec 2 jrc 4 add 5 0101 e abc e b2,rr e y e a,rr 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 sd 1 prc 2 dir 6 0110 2 jrnz 4 jp 2 jrnc 4 res 2 jrz 2 stop 2 jrc 4 inc 6 0110 e abc e b6,rr e e (y) 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 inh 1 prc 1 ind 7 0111 2 jrnz 4 jp 2 jrnc 4 set 2 jrz 4 ld 2 jrc 4 inc 7 0111 e abc e b6,rr e y,a e rr 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 sd 1 prc 2 dir 8 1000 2 jrnz 4 jp 2 jrnc 4 res 2 jrz 2 jrc 4 ld 8 1000 e abc e b1,rr e # e (y),a 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 prc 1 ind 9 1001 2 rnz 4 jp 2 jrnc 4 set 2 jrz 4 dec 2 jrc 4 ld 9 1001 e abc e b1,rr e v e rr,a 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 sd 1 prc 2 dir a 1010 2 jrnz 4 jp 2 jrnc 4 res 2 jrz 4 rcl 2 jrc 4 and a 1010 e abc e b5,rr e a e a,(y) 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 inh 1 prc 1 ind b 1011 2 jrnz 4 jp 2 jrnc 4 set 2 jrz 4 ld 2 jrc 4 and b 1011 e abc e b5,rr e v,a e a,rr 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 sd 1 prc 2 dir c 1100 2 jrnz 4 jp 2 jrnc 4 res 2 jrz 2 ret 2 jrc 4 sub c 1100 e abc e b3,rr e e a,(y) 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 inh 1 prc 1 ind d 1101 2 jrnz 4 jp 2 jrnc 4 set 2 jrz 4 dec 2 jrc 4 sub d 1101 e abc e b3,rr e w e a,rr 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 sd 1 prc 2 dir e 1110 2 jrnz 4 jp 2 jrnc 4 res 2 jrz 2 wait 2 jrc 4 dec e 1110 e abc e b7,rr e e (y) 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 inh 1 prc 1 ind f 1111 2 jrnz 4 jp 2 jrnc 4 set 2 jrz 4 ld 2 jrc 4 dec f 1111 e abc e b7,rr e w,a e rr 1 pcr 2 ext 1 pcr 2 b.d 1 pcr 1 sd 1 prc 2 dir abbreviations for addressing modes: legend: dir direct # indicates ill egal instructions sd short direct e 5-bit displacement imm immediate b 3-bit address inh inherent rr 1-byte data space address ext extended nn 1-byte immediate data b.d bit direct abc 12-bit address bt bit test ee 8-bit displacement pcr program counter relative ind indirect 2 jrc e 1 prc mnemonic addressing mode bytes cycles operands 1
ST6208C/st6209c/st6210c/st6220c 62/105 11 electrical characteristics 11.1 parameter conditions unless otherwise specified, all voltages are re- ferred to v ss . 11.1.1 minimum and maximum values unless otherwise specified the minimum and max- imum values are guaranteed in the worst condi- tions of ambient temperature, supply voltage and frequencies by tests in production on 100% of the devices with an ambient temperature at t a =25 c and t a =t a max (given by the selected temperature range). data based on characterization results, design simulation and/or technology characteristics are indicated in the table footnotes and are not tested in production. based on characterization, the min- imum and maximum values refer to sample tests and represent the mean value plus or minus three times the standard deviation (mean 3 s ). 11.1.2 typical values unless otherwise specified, typical data are based on t a =25 c, v dd =5v (for the 4.5v v dd 5.5v voltage range) and v dd =3.3v (for the 3v v dd 3.6v voltage range). they are given only as design guidelines and are not tested. 11.1.3 typical curves unless otherwise specified, all typical curves are given only as design guidelines and are not tested. 11.1.4 loading capacitor the loading conditions used for pin parameter measurement is shown in figure 36. figure 36. pin loading conditions 11.1.5 pin input voltage the input voltage measurement on a pin of the de- vice is described in figure 37. figure 37. pin input voltage c l st6 pin v in st6 pin 1
ST6208C/st6209c/st6210c/st6220c 63/105 11.2 absolute maximum ratings stresses above those listed as aabsolute maxi- mum ratingso may cause permanent damage to the device. this is a stress rating only and func- tional operation of the device under these condi- tions is not implied. exposure to maximum rating conditions for extended periods may affect device reliability. 11.2.1 voltage characteristics 11.2.2 current characteristics 11.2.3 thermal characteristics notes: 1. directly connecting the reset and i/o pins to v dd or v ss could damage the device if an unintentional internal reset is generated or an unexpected change of the i/o configuration occurs (for example, due to a corrupted program coun- ter). to guarantee safe operation, this connection has to be done through a pull-up or pull-down resistor (typical: 4.7k w for reset, 10k w for i/os). unused i/o pins must be tied in the same way to v dd or v ss according to their reset con- figuration. 2. when the current limitation is not possible, the v in absolute maximum rating must be respected, otherwise refer to i inj(pin) specification. a positive injection is induced by v in >v dd while a negative injection is induced by v in ST6208C/st6209c/st6210c/st6220c 64/105 11.3 operating conditions 11.3.1 general operating conditions notes: 1. an oscillator frequency above 1.2mhz is recommended for reliable a/d results. 2. operating conditions with t a =-40 to +125 c. figure 38. f osc maximum operating frequency versus v dd supply voltage for otp & rom devices symbol parameter condi tions min max unit v dd supply voltage see figure 38 3.0 6 v f osc oscillator frequency v dd =3.0v, 1 & 6 suffix 0 1) 4 mhz v dd =3.0v, 3 suffix 0 1) 4 v dd =3.6v, 1 & 6suffix 0 1) 8 v dd =3.6v, 3 suffix 0 1) 4 v dd operating supply voltage f osc =4mhz, 1 & 6 suffix 3.0 6.0 v f osc =4mhz, 3 suffix 3.0 6.0 f osc =8mhz, 1 & 6 suffix 3.6 6.0 f osc =8mhz, 3 suffix 4.5 6.0 t a ambient temperature range 1 suffix version 0 70 c 6 suffix version -40 85 3 suffix version -40 125 1 2.5 3.6 4 4.5 5 5.5 6 8 7 6 5 4 3 2 supply 3 f osg f osg min f osc [mhz] functionality not guaranteed in this area 3 voltage (v dd ) 2 1 1. in this area, operation is guaranteed at the quartz crystal frequency. 2. when the osg is disabled, operation in this area is guaranteed at the crystal frequency. when the 3. when the osg is disabled, operation in this area is guaranteed at the quartz crystal frequency. when osg is enabled, operation in this area is guaranteed at a frequency of at least f osg min. the osg is enabled, access to this area is prevented. the internal frequency is kept at f osg . 1 & 6 suffix version 3 suffix version 1
ST6208C/st6209c/st6210c/st6220c 65/105 operating conditions (cont'd) 11.3.2 operating conditions with low voltage detector (lvd) subject to general operating conditions for v dd ,f osc , and t a . notes: 1. lvd typical data are based on t a =25 c. they are given only as design guidelines and are not tested. 2. the minimum v dd rise time rate is needed to insure a correct device power-on and lvd reset. not tested in production. 3. data based on characterization results, not tested in production. figure 39. lvd threshold versus v dd and f osc 3) figure 40. typical lvd thresholds versus temperature for otp devices figure 41. typical lvd thresholds vs. temperature for rom devices symbol parameter condition s min typ 1) max unit v it+ reset release threshold (v dd rise) 3.9 4.1 4.3 v v it- reset generation threshold (v dd fall) 3.6 3.8 4 v hys lvd voltage threshold hysteresis v it+ -v it- 50 300 700 mv vt por v dd rise time rate 2) mv/s t g(vdd) filtered glitch delay on v dd 3) not detected by the lvd 30 ns f osc [mhz] supply 8 4 0 2.5 3 3.5 4 4.5 5 5.5 functional area reset functionali ty not guaranteed in this area v it- 3.6 device under in this area 6 voltage [v] -40 c25 c95 c 125 c t[ c] 3.6 3.8 4 4.2 thresholds [v] vdd up vdd down v it+ v it- -40 c25 c95 c 125 c t[ c] 3.6 3.8 4 4.2 thresholds [v] vdd up vdd down v it+ v it- 1
ST6208C/st6209c/st6210c/st6220c 66/105 11.4 supply current characteristics the following current consumption specified for the st6 functional operating modes over tempera- ture range does not take into account the clock source current consumption. to get the total de- vice consumption, the two current values must be added (except for stop mode for which the clock is stopped). 11.4.1 run modes notes: 1. typical data are based on t a =25 c, v dd =5v (4.5v v dd 5.5v range) and v dd =3.3v (3v v dd 3.6v range). 2. data based on characterization results, tested in production at v dd max. and f osc max. 3. cpu running with memory access, all i/o pins in input with pull-up mode (no load), all peripherals in reset state; clock input (osc in ) driven by external square wave, osg and lvd disabled, option bytes not programmed. figure 42. typical i dd in run vs. f cpu figure 43. typical i dd in run vs. temperature (v dd = 5v) symbol parameter conditions typ 1) max 2) unit i dd supply current in run mode 3) (see figure 42 & figure 43) 4.5v v dd 5.5v f osc =32khz f osc =1mhz f osc =2mhz f osc =4mhz f osc =8mhz 0.5 1.3 1.6 2.2 3.3 0.7 1.7 2.4 3.3 4.8 ma supply current in run mode 3) (see figure 42 & figure 43) 3v v dd 3.6v f osc =32khz f osc =1mhz f osc =2mhz f osc =4mhz f osc =8mhz 0.3 0.6 0.9 1.0 1.8 0.4 0.8 1.2 1.5 2.3 34 56 vdd [v] 0 1 2 3 4 5 idd [ma] 8mhz 4mhz 2mhz 1mhz 32khz -40 25 95 125 t[ c] 0 0.5 1 1.5 2 2.5 3 3.5 idd [ma] 8mhz 4mhz 2mhz 1mhz 32khz 1
ST6208C/st6209c/st6210c/st6220c 67/105 supply current characteristics (cont'd) 11.4.2 wait modes notes: 1. typical data are based on t a =25 c, v dd =5v (4.5v v dd 5.5v range) and v dd =3.3v (3v v dd 3.6v range). 2. data based on characterization results, tested in production at v dd max. and f osc max. 3. all i/o pins in input with pull-up mode (no load), all peripherals in reset state; clock input (osc in ) driven by external square wave, osg and lvd disabled. symbol parameter conditio ns typ 1) max 2) unit i dd supply current in wait mode 3) option bytes not programmed (see figure 44) 4.5v v dd 5.5v otp devices f osc =32khz f osc =1mhz f osc =2mhz f osc =4mhz f osc =8mhz 330 350 370 410 480 550 600 650 700 800 m a supply current in wait mode 3) option bytes programmed to 00h (see figure 45) f osc =32khz f osc =1mhz f osc =2mhz f osc =4mhz f osc =8mhz 18 26 41 57 70 60 80 120 180 200 supply current in wait mode 3) (see figure 46) rom devices f osc =32khz f osc =1mhz f osc =2mhz f osc =4mhz f osc =8mhz 190 210 240 280 350 300 350 400 500 600 supply current in wait mode 3) option bytes not programmed (see figure 44) 3v v dd 3.6v otp devices f osc =32khz f osc =1mhz f osc =2mhz f osc =4mhz f osc =8mhz 80 90 100 120 150 120 140 150 200 250 supply current in wait mode 3) option bytes programmed to 00h (see figure 45) f osc =32khz f osc =1mhz f osc =2mhz f osc =4mhz f osc =8mhz 5 8 16 18 20 30 40 50 60 100 supply current in wait mode 3) option bytes not programmed (see figure 46) rom devices f osc =32khz f osc =1mhz f osc =2mhz f osc =4mhz f osc =8mhz 60 65 80 100 130 100 110 120 150 210 1
ST6208C/st6209c/st6210c/st6220c 68/105 supply current characteristics (cont'd) figure 44. typical i dd in wait vs f cpu and temperature for otp devices with option bytes not programmed figure 45. typical i dd in wait vs f cpu and temperature for otp devices with option bytes programmed to 00h 34 56 vdd [v] 0 100 200 300 400 500 600 700 800 idd [ m a] 8mhz 4mhz 2mhz 1m 32khz -40 25 95 125 t[ c] 200 300 400 500 600 700 idd [ m a] 8mhz 4mhz 2mhz 1mhz 32khz 34 56 vdd [v] 0 20 40 60 80 100 120 idd [ m a] 8mhz 4mhz 2mhz 1m 32khz -20 25 95 t[ c] 10 20 30 40 50 60 70 80 90 idd [ m a] 8mhz 4mhz 2mhz 1mhz 32khz 1
ST6208C/st6209c/st6210c/st6220c 69/105 supply current characteristics (cont'd) figure 46. typical i dd in wait vs f cpu and temperature for rom devices 34 56 vdd [v] 0 100 200 300 400 500 600 idd [ m a] 8mhz 4mhz 2mhz 1m 32khz -20 25 95 125 t[ c] 100 150 200 250 300 350 400 450 idd [ m a] 8mhz 4mhz 2mhz 1mhz 32khz 1
ST6208C/st6209c/st6210c/st6220c 70/105 supply current characteristics (cont'd) 11.4.3 stop mode notes: 1. typical data are based on v dd =5.0v at t a =25 c. 2. all i/o pins in input with pull-up mode (no load), all peripherals in reset state, osg and lvd disabled, option bytes programmed to 00h. data based on characterization results, tested in production at v dd max. and f cpu max. 3. maximum stop consumption for -40 c ST6208C/st6209c/st6210c/st6220c 71/105 supply current characteristics (cont'd) 11.4.4 supply and clock system the previous current consumption specified for the st6 functional operating modes over tempera- ture range does not take into account the clock source current consumption. to get the total de- vice consumption, the two current values must be added (except for stop mode). 11.4.5 on-chip peripherals notes: 1. typical data are based on t a =25 c. 2. data based on characterization results, not tested in production. 3. data based on a differential i dd measurement between reset configuration (osg and lfao disabled) and lfao run- ning (also includes the osg stand alone consumption). 4. data based on a differential i dd measurement between reset configuration with osg disabled and osg enabled. 5. data based on a differential i dd measurement between reset configuration with lvd disabled and lvd enabled. 6. data based on a differential i dd measurement between reset configuration (timer disabled) and timer running. 7. data based on a differential i dd measurement between reset configuration and continuous a/d conversions. symbol parameter condit ions typ 1) max 2) unit i dd(ck) supply current of rc oscillator f osc =32khz, f osc =1mhz f osc =2mhz f osc =4mh f osc =8mhz v dd = 5.0v 230 260 340 480 m a f osc =32khz, f osc =1mhz f osc =2mhz f osc =4mh f osc =8mhz v dd = 3.3v 80 110 180 320 supply current of resonator oscillator f osc =32khz, f osc =1mhz f osc =2mhz f osc =4mh f osc =8mhz v dd = 5.0v 900 280 240 140 40 f osc =32khz, f osc =1mhz f osc =2mhz f osc =4mh f osc =8mhz v dd = 3.3v 120 70 50 20 10 i dd(lfao) lfao supply current 3) v dd = 5.0v 102 i dd(osg) osg supply current 4) v dd = 5.0v 40 i dd(lvd) lvd supply current 5) v dd = 5.0v 170 symbol parameter conditions typ 1) unit i dd(tim) 8-bit timer supply current 6) f osc =8mhz v dd = 5.0v 170 m a v dd = 3.3v 100 i dd(adc) adc supply current when converting 7) f osc =8mhz v dd = 5.0v 80 v dd = 3.3v 50 1
ST6208C/st6209c/st6210c/st6220c 72/105 11.5 clock and timing characteristics subject to general operating conditions for v dd ,f osc , and t a . 11.5.1 general timings 11.5.2 external clock source notes: 1. data based on typical application software. 2. time measured between interrupt event and interrupt vector fetch. d t c(inst) is the number of t cpu cycles needed to finish the current instruction execution. 3. data based on design simulation and/or technology characteristics, not tested in production. figure 49. typical application with an external clock source symbol parameter conditi ons min typ 1) max unit t c(inst) instruction cycle time 245t cpu f cpu =8mhz 3.25 6.5 8.125 m s t v(it) interrupt reaction time 2) t v(it) = d t c(inst) +6 611t cpu f cpu =8mhz 9.75 17.875 m s symbol parameter conditions min typ max unit v oscinh osc in input pin high level voltage see figure 49 0.7xv dd v dd v v oscinl osc in input pin low level voltage v ss 0.3xv dd t w(oscinh) t w(oscinl) osc in high or low time 3) ns t r(oscin) t f(oscin) osc in rise or fall time 3) i l oscx input leakage current v ss v in v dd 2 m a osc in osc out f osc external st62xx clock source v oscinl v oscinh t r(oscin) t f(oscin) t w(oscinh) t w(oscinl) i l 90% 10% not connected 1
ST6208C/st6209c/st6210c/st6220c 73/105 clock and timing characteristics (cont'd) 11.5.3 crystal and ceramic resonator oscillators the st6 internal clock can be supplied with sever- al different crystal/ceramic resonator oscillators. all the information given in this paragraph are based on characterization results with specified typical external components. refer to the crystal/ ceramic resonator manufacturer for more details (frequency, package, accuracy...). notes: 1. resonator characteristics given by the crystal/ceramic resonator manufacturer. 2. t su(osc) is the typical oscillator start-up time measured between v dd =2.8v and the fetch of the first instruction (with a quick v dd ramp-up from 0 to 5v (<50 m s). 3. the oscillator selection can be optimized in terms of supply current using an high quality resonator with small r s value. refer to crystal/ceramic resonator manufacturer for more details. figure 50. typical application with a crystal or ceramic resonator symbol parameter conditions typ unit r f feedback resistor 3 m w c l1 c l2 recommended load capacitances versus equiva- lent crystal or ceramic resonator frequency f osc =32khz, f osc =1mhz f osc =2mhz f osc =4mh f osc =8mhz 120 47 33 33 22 pf oscillator typical crystal or ceramic resonators c l1 [pf] c l2 [pf] t su(osc) [ms] 1) reference freq. characteristic 1) ceramic murata csb455e 455khz d f osc =[ 0.5khz tolerance , 0.3% d ta , 0.5% aging ] 220 220 csb1000j 1mhz d f osc =[ 0.5khz tolerance , 0.3% d ta , 0.5% aging ] 100 100 cstcc2.00mg0h6 2mhz d f osc =[ 0.5% tolerance , 0.5% d ta , 0.3% aging ]4747 cstcc4.00mg0h6 4mhz d f osc =[ 0.5% tolerance , 0.3% d ta , 0.3% aging ]4747 cstcc8.00mg 8mhz d f osc =[ 0.5% tolerance , 0.3% d ta , 0.3% aging ]1515 osc out osc in c l1 c l2 r f st62xx resonator v dd f osc 1
ST6208C/st6209c/st6210c/st6220c 74/105 clock and timing characteristics (cont'd) 11.5.4 rc oscillator the st6 internal clock can be supplied with an ex- ternal rc oscillator. notes: 1. data based on characterization results, not tested in production. these measurements were done with the oscin pin unconnected (only soldered on the pcb). 2. r net must have a positive temperature coefficient (ppm/ c), carbon resistors should therefore not be used. figure 51. typical application with rc oscillator symbol parameter conditio ns min typ max unit f osc rc oscillator frequency 1) 4.5v v dd 5.5v r net =22k w r net =47k w r net =100k w r net =220k w r net =470k w 7.2 5.1 3.2 1.8 0.9 8.6 5.7 3.4 1.9 0.95 10 6.5 3.8 2 1.1 mhz 3v v dd 3.6v r net =22k w r net =47k w r net =100k w r net =220k w r net =470k w 3.7 2.8 1.8 1 0.5 4.3 3 1.9 1.1 0.55 4.9 3.3 2 1.2 0.6 r net rc oscillator external resistor 2) see figure 52 & figure 53 22 870 k w osc in osc out r net external rc c ex ~9pf discharge st62xx v dd v dd f osc v dd nc current copy 1
ST6208C/st6209c/st6210c/st6220c 75/105 clock and timing characteristics (cont'd) figure 52. typical rc oscillator frequency vs. r net figure 53. typical rc oscillator frequency vs. temperature (v dd = 5v) 11.5.5 oscillator safeguard (osg) and low frequency auxiliary oscillator (lfao) figure 54. typical lfao frequencies note: 1. data based on characterization results. 3456 vdd [v] 0 2 4 6 8 10 12 fosc [mhz] rnet=22kohm rnet=47kohm rnet=100kohm rnet=220kohm rnet=470kohm -40 25 95 125 ta [ c] 0 2 4 6 8 10 fosc [mhz] rnet=22kohm rnet=47kohm rnet=100kohm rnet=220kohm rnet=470kohm symbol parameter conditions min typ max unit f lfao low frequency auxiliary oscillator frequency 1) t a = 25 c, v dd = 5.0v 200 350 800 khz t a = 25 c, v dd = 3.3v 86 150 340 f osg internal frequency with osg ena- bled t a = 25 c, v dd = 4.5v 4 mhz t a = 25 c, v dd = 3.3v 2 3456 vdd [v] 0 100 200 300 400 500 600 fosc [khz] ta=-40 c ta=25 c ta=125 c 1
ST6208C/st6209c/st6210c/st6220c 76/105 11.6 memory characteristics subject to general operating conditions for v dd ,f osc , and t a unless otherwise specified. 11.6.1 ram and hardware registers 11.6.2 eprom program memory figure 55. eprom retention time vs. temperature notes: 1. minimum v dd supply voltage without losing data stored in ram (in stop mode or under reset) or in hardware reg- isters (only in stop mode). guaranteed by construction, not tested in production. 2. data based on reliability test results and monitored in production. 3. the data retention time increases when the t a decreases, see figure 55. symbol parameter conditi ons min typ max unit v rm data retention 1) 0.7 v symbol parameter conditions min typ max unit t ret data retention 2) t a =+55 c 3) 10 years -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 temperature [ c] 0.1 1 10 100 1000 10000 100000 retention time [years] 1
ST6208C/st6209c/st6210c/st6220c 77/105 11.7 emc characteristics susceptibility tests are performed on a sample ba- sis during product characterization. 11.7.1 functional ems (electro magnetic susceptibility) based on a simple running application on the product (toggling 2 leds through i/o ports), the product is stressed by two electro magnetic events until a failure occurs (indicated by the leds). n esd : electro-static discharge (positive and negative) is applied on all pins of the device until a functional disturbance occurs. this test conforms with the iec 1000-4-2 standard. n ftb : a burst of fast transient voltage (positive and negative) is applied to v dd and v ss through a 100pf capacitor, until a functional disturbance occurs. this test conforms with the iec 1000-4- 4 standard. a device reset allows normal operations to be re- sumed. notes: 1. data based on characterization results, not tested in production. 2. the suggested 10nf and 0.1 m f decoupling capacitors on the power supply lines are proposed as a good price vs. emc performance tradeoff. they have to be put as close as possible to the device power supply pins. other emc recom- mendations are given in other sections (i/os, reset, oscx pin characteristics). figure 56. emc recommended star network power supply connection 2) symbol parameter condition s neg 1) pos 1) unit v fesd voltage limits to be applied on any i/o pin to induce a functional disturbance v dd = 5v, t a = +25 c, f osc = 8mhz conforms to iec 1000-4-2 -2 2 kv v fftb fast transient voltage burst limits to be ap- plied through 100pf on v dd and v dd pins to induce a functional disturbance v dd = 5v, t a = +25 c, f osc = 8mhz conforms to iec 1000-4-4 -2.5 3 v dd v ss 0.1 m f 10nf v dd st62xx power supply source st6 digital noise filtering (close to the mcu) 1
ST6208C/st6209c/st6210c/st6220c 78/105 emc characteristics (cont'd) 11.7.2 absolute electrical sensitivity based on three different tests (esd, lu and dlu) using specific measurement methods, the product is stressed in order to determine its performance in terms of electrical sensitivity. for more details, re- fer to the an1181 application note. 11.7.2.1 electro-static discharge (esd) electro-static discharges (3 positive then 3 nega- tive pulses separated by 1 second) are applied to the pins of each sample according to each pin combination. the sample size depends of the number of supply pins of the device (3 parts*(n+1) supply pin). two models are usually simulated: human body model and machine model. this test conforms to the jesd22-a114a/a115a standard. see figure 57 and the following test sequences. human body model test sequence c l is loaded through s1 by the hv pulse gener- ator. s1 switches position from generator to r. a discharge from c l through r (body resistance) to the st6 occurs. s2 must be closed 10 to 100ms after the pulse delivery period to ensure the st6 is not left in charge state. s2 must be opened at least 10ms prior to the delivery of the next pulse. machine model test sequence c l is loaded through s1 by the hv pulse gener- ator. s1 switches position from generator to st6. a discharge from c l to the st6 occurs. s2 must be closed 10 to 100ms after the pulse delivery period to ensure the st6 is not left in charge state. s2 must be opened at least 10ms prior to the delivery of the next pulse. r (machine resistance), in series with s2, en- sures a slow discharge of the st6. absolute maximum ratings notes: 1. data based on characterization results, not tested in production. figure 57. typical equivalent esd circuits symbol ratings conditions maximum value 1) unit v esd(hbm) electro-static discharge voltage (human body model) t a = +25 c 2000 v v esd(mm) electro-static discharge voltage (machine model) t a = +25 c 200 st6 s2 r=1500 w s1 high voltage c l = 100pf pulse generator st6 s2 high voltage c l = 200pf pulse generat or r=10k~10m w s1 human body model machine model 1
ST6208C/st6209c/st6210c/st6220c 79/105 emc characteristics (cont'd) 11.7.2.2 static and dynamic latch-up n lu : 3 complementary static tests are required on 10 parts to assess the latch-up performance. a supply overvoltage (applied to each power supply pin), a current injection (applied to each input, output and configurable i/o pin) and a power supply switch sequence are performed on each sample. this test conforms to the eia/ jesd 78 ic latch-up standard. for more details, refer to the an1181 application note. n dlu : electro-static discharges (one positive then one negative test) are applied to each pin of 3 samples when the micro is running to assess the latch-up performance in dynamic mode. power supplies are set to the typical values, the oscillator is connected as near as possible to the pins of the micro and the component is put in reset mode. this test conforms to the iec1000-4-2 and saej1752/3 standards and is described in figure 58. for more details, refer to the an1181 application note. electrical sensitivities notes: 1. class description: a class is an stmicroelectronics internal specification. all its limits are higher than the jedec spec- ifications, that means when a device belongs to class a it exceeds the jedec standard. b class strictly covers all the jedec criteria (international standard). 2. schaffner nsg435 with a pointed test finger. figure 58. simplified diagram of the esd generator for dlu symbol parameter conditions class 1) lu static latch-up class t a = +25 c t a = +85 c a a dlu dynamic latch-up class v dd = 5v, f osc = 4mhz, t a = +25 c r ch =50m w r d =330 w c s = 150pf esd hv relay dischar ge tip discharge return connection generator 2) st6 v dd v ss 1
ST6208C/st6209c/st6210c/st6220c 80/105 emc characteristics (cont'd) 11.7.3 esd pin protection strategy to protect an integrated circuit against electro- static discharge the stress must be controlled to prevent degradation or destruction of the circuit el- ements. the stress generally affects the circuit el- ements which are connected to the pads but can also affect the internal devices when the supply pads receive the stress. the elements to be pro- tected must not receive excessive current, voltage or heating within their structure. an esd network combines the different input and output esd protections. this network works, by al- lowing safe discharge paths for the pins subjected to esd stress. two critical esd stress cases are presented in figure 59 and figure 60 for standard pins. standard pin protection to protect the output structure the following ele- ments are added: a diode to v dd (3a) and a diode from v ss (3b) a protection device between v dd and v ss (4) to protect the input structure the following ele- ments are added: a resistor in series with the pad (1) a diode to v dd (2a) and a diode from v ss (2b) a protection device between v dd and v ss (4) figure 59. positive stress on a standard pad vs. v ss figure 60. negative stress on a standard pad vs. v dd in v dd v ss (1) (2a) (2b) (4) out v dd v ss (3a) (3b) main path path to avoid in v dd v ss (1) (2a) (2b) (4) out v dd v ss (3a) (3b) main path 1
ST6208C/st6209c/st6210c/st6220c 81/105 11.8 i/o port pin characteristics 11.8.1 general characteristics subject to general operating conditions for v dd ,f osc , and t a unless otherwise specified. figure 61. typical r pu vs. v dd with v in =v ss notes: 1. unless otherwise specified, typical data are based on t a =25 c and v dd =5v. 2. data based on characterization results, not tested in production. 3. hysteresis voltage between schmitt trigger switching levels. based on characterization results, not tested. 4. the r pu pull-up equivalent resistor is based on a resistive transistor. this data is based on characterization results, not tested in production. 5. data based on characterization results, not tested in production. 6. to generate an external interrupt, a minimum pulse width has to be applied on an i/o port pin configured as an external interrupt source. figure 62. two typical applications with unused i/o pin symbol parameter conditions min typ 1) max unit v il input low level voltage 2) 0.3xv dd v v ih input high level voltage 2) 0.7xv dd v hys schmitt trigger voltage hysteresis 3) v dd =5v 200 400 mv v dd =3.3v 200 400 i l input leakage current v ss v in v dd (no pull-up configured) 0.1 1 m a r pu weak pull-up equivalent resistor 4) v in = v ss v dd =5v 40 110 350 k w v dd =3.3v 80 230 700 c in i/o input pin capacitance 5 10 pf c out i/o output pin capacitance 5 10 pf t f(io)out output high to low level fall time 5) c l =50pf between 10% and 90% 30 ns t r(io)out output low to high level rise time 5) 35 t w(it)in external interrupt pulse time 6) 1t cpu 34 56 vdd [v] 50 100 150 200 250 300 350 rpu [khom] ta=-40 c ta=25 c ta=95 c ta=125 c 10k w unused i/o port st62xx 10k w unused i/o port st62xx v dd 1
ST6208C/st6209c/st6210c/st6220c 82/105 i/o port pin characteristics (cont'd) 11.8.2 output driving current subject to general operating conditions for v dd ,f osc , and t a unless otherwise specified. notes: 1. the i io current sunk must always respect the absolute maximum rating specified in section 11.2.2 and the sum of i io (i/o ports and control pins) must not exceed i vss . 2. the i io current source must always respect the absolute maximum rating specified in section 11.2.2 and the sum of i io (i/o ports and control pins) must not exceed i vdd . true open drain i/o pins does not have v oh . figure 63. typical v ol at v dd = 5v (standard) figure 64. typical v ol at v dd = 5v (high-sink) symbol parameter condition s min max unit v ol 1) output low level voltage for a standard i/o pin (see figure 63 and figure 66) v dd =5v i io =+10 m a, t a 125 c 0.1 v i io =+3ma, t a 125 c 0.8 i io =+5ma, t a 85 c 0.8 i io =+10ma, t a 85 c 1.2 output low level voltage for a high sink i/o pin (see figure 64 and figure 67) i io =+10 m a, t a 125 c 0.1 i io =+7ma, t a 125 c 0.8 i io =+10ma, t a 85 c 0.8 i io =+15ma, t a 125 c 1.3 i io =+20ma, t a 85 c 1.3 i io =+30ma, t a 85 c2 v oh 2) output high level voltage for an i/o pin (see figure 65 and figure 68) i io =-10 m a, t a 125 cv dd -0.1 i io =-3ma, t a 125 cv dd -1.5 i io =-5ma, t a 85 cv dd -1.5 024 6810 iio [ma] 0 200 400 600 800 1000 vol [mv] at vdd=5v ta=-40 c ta=25 c ta=95 c ta=125 c 048121620 iio [ma] 0 0.2 0.4 0.6 0.8 1 vol [v] at vdd=5v ta=-40 c ta=25 c ta=95 c ta=125 c 1
ST6208C/st6209c/st6210c/st6220c 83/105 i/o port pin characteristics (cont'd) figure 65. typical v oh at v dd =5v figure 66. typical v ol vs v dd (standard i/os) figure 67. typical v ol vs v dd (high-sink i/os) -8 -6 -4 -2 0 iio [ma] 3.5 4 4.5 5 voh [v] at vdd=5v ta=-40 c ta=25 c ta=95 c ta=125 c 3456 vdd [v] 150 200 250 300 350 vol [mv] at iio=2ma ta=-40 c ta=25 c ta=95 c ta=125 c 3456 vdd [v] 300 400 500 600 700 vol [mv] at iio=5ma ta=-40 c ta=25 c ta=95 c ta=125 c 3456 vdd [v] 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 vol [v] at iio=8ma ta=-40 c ta=25 c ta=95 c ta=125 c 3456 vdd [v] 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 vol [v] at iio=20ma ta=-40 c ta=25 c ta=95 c ta=125 c 1
ST6208C/st6209c/st6210c/st6220c 84/105 i/o port pin characteristics (cont'd) figure 68. typical v oh vs v dd 3456 vdd [v] 2 3 4 5 6 voh [v] at iio=-2ma ta=-40 c ta=25 c ta=95 c ta=125 c 3456 vdd [v] 1 2 3 4 5 6 voh [v] at iio=-5ma ta=-40 c ta=25 c ta=95 c ta=125 c 1
ST6208C/st6209c/st6210c/st6220c 85/105 11.9 control pin characteristics 11.9.1 asynchronous reset pin subject to general operating conditions for v dd ,f osc , and t a unless otherwise specified. notes: 1. unless otherwise specified, typical data are based on t a =25 c and v dd =5v. 2. data based on characterization results, not tested in production. 3. hysteresis voltage between schmitt trigger switching levels. based on characterization results, not tested. 4. the r on pull-up equivalent resistor is based on a resistive transistor. this data is based on characterization results, not tested in production. 5. all short pulse applied on reset pin with a duration below t h(rstl)in can be ignored. 6. the reset network protects the device against parasitic resets, especially in a noisy environment. 7. the output of the external reset circuit must have an open-drain output to drive the st6 reset pad. otherwise the device can be damaged when the st6 generates an internal reset (lvd or watchdog). figure 69. typical r on vs v dd with v in =v ss symbol parameter condit ions min typ 1) max unit v il input low level voltage 2) 0.3xv dd v v ih input high level voltage 2) 0.7xv dd v hys schmitt trigger voltage hysteresis 3) 200 400 mv r on weak pull-up equivalent resistor 4) v in = v ss v dd =5v 150 350 900 k w v dd =3.3v 300 730 1900 r esd esd resistor protection v in = v ss v dd =5v 2.8 k w v dd =3.3v t w(rstl)out generated reset pulse duration external pin or internal reset sources t cpu m s t h(rstl)in external reset pulse hold time 5) m s t g(rstl)in filtered glitch duration 6) ns 34 56 vdd [v] 100 200 300 400 500 600 700 800 900 1000 ron [kohm] ta=-40 c ta=25 c ta=95 c ta=125 c 1
ST6208C/st6209c/st6210c/st6220c 86/105 control pin characteristics (cont'd) figure 70. typical application with reset pin 8) 11.9.2 nmi pin subject to general operating conditions for v dd ,f osc , and t a unless otherwise specified. notes: 1. unless otherwise specified, typical data are based on t a =25 c and v dd =5v. 2. data based on characterization results, not tested in production. 3. hysteresis voltage between schmitt trigger switching levels. based on characterization results, not tested. 4. the r pull-up equivalent resistor is based on a resistive transistor. this data is based on characterization results, not tested in production. figure 71. typical r pull-up vs. v dd with v in =v ss 0.1 m f v dd 0.1 m f v dd 4.7k w exte rnal reset circuit 7) op t ion al f int counter reset watch dog rese t lvd rese t inte rnal re set r esd 1) v dd r pu stop mode 2048 external clock cycles symbol parameter condit ions min typ 1) max unit v il input low level voltage 2) 0.3xv dd v v ih input high level voltage 2) 0.7xv dd v hys schmitt trigger voltage hysteresis 3) 200 400 mv r pull-up weak pull-up equivalent resistor 4) v in = v ss v dd =5v 40 100 350 k w v dd =3.3v 80 200 700 3456 vdd [v] 50 100 150 200 250 300 rpull-up [kohm] ta=-40 c ta=25 c ta=95 c ta=125 c 1
ST6208C/st6209c/st6210c/st6220c 87/105 control pin characteristics (cont'd) 11.10 timer peripheral characteristics subject to general operating conditions for v dd , f osc , and t a unless otherwise specified. refer to i/o port characteristics for more details on the input/output alternate function characteristics (timer). 11.10.1 watchdog timer 11.10.2 8-bit timer symbol parameter conditions min typ max unit t w(wdg) watchdog time-out duration 3,072 196,608 t int f cpu =4mhz 0.768 49.152 ms f cpu =8mhz 0.384 24.576 ms symbol parameter condit ions min typ max unit f ext timer external clock frequency 0 f int /4 mhz t w pulse width at timer pin vdd>4.5v 125 ns vdd=3v 1 m s 1
ST6208C/st6209c/st6210c/st6220c 88/105 11.11 8-bit adc characteristics subject to general operating conditions for v dd ,f osc , and t a unless otherwise specified. notes: 1. unless otherwise specified, typical data are based on t a =25 c and v dd =5v. 2. the adc refers to v dd and v ss . 3. any added external serial resistor will downgrade the adc accuracy (especially for resistance greater than 10k w ). data based on characterization results, not tested in production. 4. as a stabilization time for the ad converter is required, the first conversion after the enable can be wrong. figure 72. typical application with adc note: adc not present on some devices. see device summary on page 1. symbol parameter conditions min typ 1) max unit f osc clock frequency 1.2 f osc mhz v ain conversion range voltage 2) v ss v dd v r ain external input resistor 10 3) k w t adc total convertion time f osc =8mhz f osc =4mhz 70 140 m s t stab stabilization time 4) 24t cpu f osc =8mhz 3.25 6.5 m s ad i analog input current during conver- sion 1.0 m a ac in analog input capacitance 2 5 pf ainx st62xx v ain r ain 10pf adc 10m w r 150 w 1
ST6208C/st6209c/st6210c/st6220c 89/105 8-bit adc characteristics (cont'd) adc accuracy notes: 1. negative injection disturbs the analog performance of the device. in particular, it induces leakage currents throughout the device including the analog inputs. to avoid undesirable effects on the analog functions, care must be taken: - analog input pins must have a negative injection less than 1ma (assuming that the impedance of the analog voltage is lower than the specified limits). - pure digital pins must have a negative injection less than 1ma. in addition, it is recommended to inject the current as far as possible from the analog input pins. 2. data based on characterization results over the whole temperature range, monitored in production. figure 73. adc accuracy characteristics note: adc not present on some devices. see device summary on page 1. symbol parameter conditions min typ. max unit |e t | total unadjusted error 1) v dd =5v 2) f osc =8mhz 1.2 2, fosc>1.2mhz 4, fosc>32khz lsb e o offset error 1) 0.72 e g gain error 1) -0.31 |e d | differential linearity error 1) 0.54 |e l | integral linearity error 1) e o e g 1 lsb ideal 1lsb ideal v dda v ssa 256 ---------------------------------------- - = v in (lsb ideal ) (1) example of an actual transfer curve (2) the ideal transfer curve (3) end point correlation line e t =total unadjusted error: maximum deviation between the actual and the ideal transfer curves. e o =offset error: deviation between the first actual transition and the first ideal one. e g =gain error: deviation between the last ideal transition and the last actual one. e d =differential linearity error: maximum deviation between actual steps and the ideal one. e l =integral linearity error: maximum deviation between any actual transition and the end point correlation line. digital result adcdr 255 254 253 5 4 3 2 1 0 7 6 1234567 253 254 255 256 (1) (2) e t e d e l (3) v dda v ssa 1
ST6208C/st6209c/st6210c/st6220c 90/105 12 general information 12.1 package mechanical data figure 74. 20-pin plastic dual in-line package, 300-mil width figure 75. 20-pin ceramic side-brazed dual in-line package dim. mm inches min typ max min typ max a 5.33 0.210 a1 0.38 0.015 a2 2.92 3.30 4.95 0.115 0.130 0.195 b 0.36 0.46 0.56 0.014 0.018 0.022 b2 1.14 1.52 1.78 0.045 0.060 0.070 c 0.20 0.25 0.36 0.008 0.010 0.014 d 24.89 26.92 0.980 1.060 e 2.54 0.100 e1 6.10 6.35 7.11 0.240 0.250 0.280 l 2.92 3.30 3.81 0.115 0.130 0.150 number of pins n 20 pdip20 dim. mm inches min typ max min typ max a 3.63 0.143 a1 0.38 0.015 b 3.56 0.46 0.56 0.140 0.018 0.022 b1 1.14 12.70 1.78 0.045 0.500 0.070 c 0.20 0.25 0.36 0.008 0.010 0.014 d 24.89 25.40 25.91 0.980 1.000 1.020 d1 22.86 0.900 e1 6.99 7.49 8.00 0.275 0.295 0.315 e 2.54 0.100 g 6.35 6.60 6.86 0.250 0.260 0.270 g1 9.47 9.73 9.98 0.373 0.383 0.393 g2 1.14 0.045 l 2.92 3.30 3.81 0.115 0.130 0.150 s 12.70 0.500 4.22 0.166 number of pins n20 cdip20w 1
ST6208C/st6209c/st6210c/st6220c 91/105 package mechanical data (cont'd) figure 76. 20-pin plastic small outline package, 300-mil width figure 1. 20-pin plastic shrink small outline package dim. mm inches min typ max min typ max a 2.35 2.65 0.0926 0.1043 a1 0.10 0.0040 b 0.33 0.51 0.0130 0.0200 c 0.32 0.0125 d 4.98 13.00 0.1961 0.5118 e 7.40 7.60 0.2914 0.2992 e 1.27 0.050 h 10.01 10.64 0.394 0.419 h 0.25 0.74 0.010 0.029 k 0 8 0 8 l 0.41 1.27 0.016 0.050 g 0.10 0.004 number of pins n20 so20 dim. mm inches min typ max min typ max a 1.73 1.86 1.99 0.068 0.073 0.078 a1 0.05 0.13 0.21 0.002 0.005 0.008 b 0.25 0.38 0.010 0.015 c 0.09 0.20 0.004 0.008 d 7.07 7.20 7.33 0.278 0.283 0.289 e 7.65 7.80 7.90 0.301 0.307 0.311 e1 5.20 5.30 5.38 0.205 0.209 0.212 e 0.65 0.026 g 0.08 0.003 k 0 4 8 0 4 8 l 0.63 0.75 0.95 0.025 0.030 0.037 number of pins n20 ssop20 1
ST6208C/st6209c/st6210c/st6220c 92/105 12.2 thermal characteristics notes: 1. the power dissipation is obtained from the formula p d =p int +p port where p int is the chip internal power (i dd xv dd ) and p port is the port power dissipation determined by the user. 2. the average chip-junction temperature can be obtained from the formula t j =t a +p d x rthja. symbol ratings value unit r thja package thermal resistance (junction to ambient) dip20 so20 ssop20 60 80 115 c/w p d power dissipation 1) 500 mw t jmax maximum junction temperature 2) 150 c 1
ST6208C/st6209c/st6210c/st6220c 93/105 12.3 soldering and glueability information recommended soldering information given only as design guidelines in figure 2 and figure 3. recommended glue for smd plastic packages: n heraeus: pd945, pd955 n loctite: 3615, 3298 figure 2. recommended wave soldering profile (with 37% sn and 63% pb) figure 3. recommended reflow soldering oven profile (mid jedec) 250 200 150 100 50 0 40 80 120 160 time [sec] temp. [ c] 20 60 100 140 5 sec cooling phase (room temperature) preheating 80 c phase soldering phase 250 200 150 100 50 0 100 200 300 400 time [sec] temp. [ c] ramp up 2 c/sec for 50sec 90 sec at 125 c 150 sec above 183 c ramp down natural 2 c/sec max tmax=220+/-5 c for 25 sec 1
ST6208C/st6209c/st6210c/st6220c 94/105 12.4 package/socket footprint proposal table 23. suggested list of dip20 socket types table 24. suggested list of so20 socket types table 25. suggested list of ssop20 socket types package / probe adaptor / socket reference same footp rint socket type dip20 textool 220-33-42 x textool package / probe adaptor / socket reference same footp rint socket type so20 enplas ots-20-1.27-04 open top yamaichi ic51-0202-714 clamshell emu probe adapter from so20 to dip20 footprint (delivered with emulator) x smd to dip programming adapter logical systems pa20so1-08h-6 x open top package / probe adaptor / socket reference same footp rint socket type ssop20 enplas ots-20-0.65-01 x open top programming adapter logical systems pa20ss-ot-6 x open top 1
ST6208C/st6209c/st6210c/st6220c 95/105 12.5 ordering information the following section deals with the procedure for transfer of customer codes to stmicroelectronics and also details the st6 factory coded device type. figure 4. st6 factory coded device types rom code temperature code: 1: standard 0 to +70 c 3: automotive -40 to +125 c 6: industrial -40 to +85 c package type: b: plastic dip d: ceramic dip m: plastic sop n: plastic ssop t: plastic tqfp revision index: b,c: product definition change l: low voltage device st6 sub family version code: no char: rom e: eprom p: fastrom t: otp family st62t20cb6/ccc 1
ST6208C/st6209c/st6210c/st6220c 96/105 12.6 transfer of customer code customer code is made up of the rom contents and the list of the selected fastrom options. the rom contents are to be sent on diskette, or by electronic means, with the hexadecimal file generated by the development tool. all unused bytes must be set to ffh. the selected options are communicated to stmicroelectronics using the correctly filled op- tion list appended. the stmicroelectronics sales organization will be pleased to provide detailed information on con- tractual points. listing generation and verification. when stmicroelectronics receives the user's rom con- tents, a computer listing is generated from it. this listing refers exactly to the rom contents and op- tions which will be used to produce the specified mcu. the listing is then returned to the customer who must thoroughly check, complete, sign and return it to stmicroelectronics. the signed listing forms a part of the contractual agreement for the production of the specific customer mcu. 12.6.1 fastrom version the st62p08c/p09c/p10c and p20c are the f actory a dvanced s ervice t echnique rom (fas- trom) versions of st62t08c, t09c, t10c and t20c otp devices. they offer the same functionality as otp devices, but they do not have to be programmed by the customer. the customer code must be sent to stmicroelectronics in the same way as for rom devices. the fastrom option list has the same options as defined in the programmable option byte of the otp version. 1
ST6208C/st6209c/st6210c/st6220c 97/105 transfer of customer code (cont'd) st62p08c/p09c/p10c/p20c microcontroller option list customer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... address: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... ................................................................. contact: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... phone: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... reference: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... stmicroelectronics references: device: [ ] st62p08c (1kb) [ ] st62p09c (1kb) [ ] st62p10c (2kb) [ ] st62p20c (4kb) package: [ ] dual in line plastic [ ] small outline plastic with conditioning [ ] shrink small outline plastic with conditioning conditioning option: [ ] standard (tube) [ ] tape & reel temperature range: [ ] 0 cto+70 c[]-40 cto+85 c []-40 c to + 125 c external stop mode control: [ ] enabled [ ] disabled low voltage detector: [ ] enabled [ ] disabled readout protection: [ ] enabled [ ] disabled oscillator selection: [ ] quartz crystal / ceramic resonator [ ] rc network nmi pin pull-up: [ ] enabled [ ] disabled timer pin pull-up: [ ] enabled [ ] disabled watchdog selection: [ ] software activation [ ] hardware activation oscillator safeguard: [ ] enabled [ ] disabled comments: supply operating range in the application: . . . . . . . . . . . . ............................ notes: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... date: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... signature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... 1
ST6208C/st6209c/st6210c/st6220c 98/105 transfer of customer code (cont'd) 12.6.2 rom version the ST6208C, 09c, 10c and 20c are mask pro- grammed rom version of st62t08c, t09c, t10c and t20c otp devices. they offer the same functionality as otp devices, selecting as rom options the options defined in the programmable option byte of the otp version. figure 5. programming circuit note: zpd15 is used for overvoltage protection rom readout protection. if the rom readout protection option is selected, a protection fuse can be blown to prevent any access to the program memory content. in case the user wants to blow this fuse, high volt- age must be applied on the test pin. figure 6. programming wave form vr02003 test 5v 100nf 4.7 m f protect 100nf v dd v ss zpd15 15v 14v 0.5s min test 15 14v typ 10 5 test 400ma 4ma typ vr02001 max 150 m styp t 1
ST6208C/st6209c/st6210c/st6220c 99/105 transfer of customer code (cont'd) ST6208C, 09c, 10c and 20c microcontroller option list customer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... address: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... ................................................................. contact: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... phone: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... reference: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... stmicroelectronics references: device: [ ] ST6208C (1kb) [ ] st6209c (1kb) [ ] st6210c (2kb) [ ] st6220c (4kb) package: [ ] dual in line plastic [ ] small outline plastic with conditioning [ ] shrink small outline plastic with conditioning conditioning option: [ ] standard (tube) [ ] tape & reel temperature range: [ ] 0 cto+70 c[]-40 cto+85 c []-40 c to + 125 c special marking: [ ]no [ ]yes o_ _ _ _ _ _ _ _ _ _ o authorized characters are letters, digits, '.', '-', '/' and spaces only. maximum character count: pdip20: 10 so20: 8 ssop20: 10 external stop mode control: [ ] enabled [ ] disabled low voltage detector: [ ] enabled [ ] disabled readout protection: [ ] disabled [ ] enabled (fuse is blown by stmicroelectronics) [ ] enabled (fuse can be blown by the customer) oscillator selection: [ ] quartz crystal / ceramic resonator [ ] rc network nmi pin pull-up: [ ] enabled [ ] disabled timer pin pull-up: [ ] enabled [ ] disabled watchdog selection: [ ] software activation [ ] hardware activation oscillator safeguard: [ ] enabled [ ] disabled comments: supply operating range in the application: . . . . . . . . . . . . ............................ notes: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... date: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... signature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................... 1
ST6208C/st6209c/st6210c/st6220c 100/105 13 development tools stmicroelectronics offers a range of hardware and software development tools for the st6 micro- controller family. full details of tools available for the st6 from third party manufacturers can be ob- tain from the stmicroelectronics internet site: ? http://mcu.st.com. third party tools n raisonance n actum n advanced equipment corp. n advanced transdata corp. n bp n ceibo n softec n data i/o tools from these manufacturers include c compil- ers, emulators and gang programmers. table 26. dedicated third parties development tools third party designation st sales type web site address actum st-realizer ii: graphical schematic based development available from stmicroelectronics . strealizer-ii http://www.actum.com/ ceibo low cost emulator available from ceibo. http://www.ceibo.com/ raisonance this tool includes in the same environment: an assembler, linker, c compiler, debugger and simulator. the assembler package (plus limited c compiler) is free and can be downloaded from raisonance web site. the full version is available both from stmicroelectronics and raisonance. st6rais-swc/pc http://www.raisonance.com/ softec high end emulator available from softec. http://www.softecmicro.com/ 1
ST6208C/st6209c/st6210c/st6220c 101/105 development tools (cont'd) stmicroelectronics tools four types of development tool are offered by st, all of them connect to a pc via a parallel or serial port: see table 27 and table 28 for more details. table 27. stmicroelectronics tool features table 28. dedicated stmicroelectronics development tools emulation type programming capabili ty software included st6 starter kit device simulation (limited emulation as interrupts are not supported) yes (dip packages only) mcu cd rom with: rkit-st6 from raisonance st6 assembly toolchain wgdb6 powerful source level debugger for win 3.1, win 95 and nt various software demo ver- sions. windows programming tools for win 3.1, win 95 and nt st6 hds2 emulator in-circuit powerful emula- tion features including trace/ logic analyzer no st6 eprom programmer board no yes st6 gang programmer no yes supported products st6 starter kit st6 hds2 emulator st6 programming board st6 gang programmer ST6208C, st6209c, st6210c and st6220c st622xc-kit complete: st626x-emu2 st62gp-emu2 dedication board: st626x-dbe st62gp-dbe st62e2xc-epb complete: st62e10-gp/dip or /so adaptor: st62e10-gpa/dip or /so 1
ST6208C/st6209c/st6210c/st6220c 102/105 14 st6 application notes identification description motor control an392 microcontroller and triacs on the 110/240v mains an414 controlling a brush dc motor with an st6265 mcu an416 sensorless motor drive with the st62 mcu + triac an422 improves universal motor drive an863 improved sensorless control with the st62 mcu for universal motor battery management an417 from nicd to nimh fast battery charging an433 ultra fast battery charger using st6210 microcontroller an859 an intelligent one hour multicharger for li-ion, nimh and nicd batteries fuzzy logi c an419 an approach to motor control with fuzzy logic an595 fuzzy vacuum cleaner using st6220 and fuzzytech tm st6 explorer an597 temperature control using fuzzy logic an598 cascading fuzzy modules with st6 fuzzytech an675 a rapid charger for batteries with fuzzy logic home appliance an674 microcontrollers in home appliances: a soft revolution an885 st62 microcontrollers drive home appliance motor technology graphical design an676 battery charger using the st6-realizer an677 painless microcontroller code by graphical application description an839 analog multiple key decoding using the st6-realizer an840 coded lock using the st6-realizer an841 a clock design using the st6-realizer an842 7 segment display drive using the st6-realizer cost reduction an431 using st6 analog inputs for multiple key decoding an594 direct software lcd drive with st621x and st626x an672 optimizing the st6 a/d converter accuracy an673 reducing current consumption at 32khz with st62 design improvements an420 expanding a/d resolution of the st6 a/d converter an432 using st62xx i/o ports safely an434 movement detector concepts for noisy environments an435 designing with microcontrollers in noisy environments an669 simple reset circuits for the st6 an670 oscillator selection for st62 an671 prevention of data corruption in st6 on-chip eeprom an911 st6 micro is emc champion an975 upgrading from st625x/6xb to st625x/6xc an1015 softw are techniques for improving st6 emc performance 1
ST6208C/st6209c/st6210c/st6220c 103/105 peripheral operations an590 pwm generation with st62 auto-reload timer an591 input capture with st62 auto-reload timer an592 pll generation using the st62 auto-reload timer an593 st62 in-circuit programming an678 lcd driving with st6240 an913 pwm generation with st62 16-bit auto-reload timer an914 using st626x spi as uart an1016 st6 using the st623xb/st628xb uart an1050 st6 input capture with st62 16-bit auto-reload timer an1127 using the st62t6xc/5xc spi in master mode general an683 mcus - 8/16-bit microcontrollers (mcus) application notes abstracts by topics an886 selecting between rom and otp for a microcontroller an887 making it easy with microcontrollers an898 emc general information an899 soldering recommendations and packaging information an900 introduction to semiconductor technology an901 emc guide-lines for microcontroller - based applications an902 quality and reliability information an912 a simple guide to development tools an1181 electrostatic disharge sensitivi ty measurement identification description 1
ST6208C/st6209c/st6210c/st6220c 104/105 15 summary of changes description of the changes between the current release of the specification and the previous one. 16 to get more information to get the latest information on this product please use the stmicroelectronics web server. ? http://mcu.st.com/ revision main changes date 3.0 complementary information added to the functional description throughout the document in the form of explanatory application notes. added graphic presentation to the parametric data. footnotes added to the tables for clari- fication of the parametric information. renamed the following registers: - dwr to drwr - psc to pscr - dwdr to wdgr june 2000 1
ST6208C/st6209c/st6210c/st6220c 105/105 notes: information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specifications mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics products are not authorized for use as critical components in life support devices or systems without the express written approval of stmicroelectronics. the st logo is a registered trademark of stmicroelectronics ? 2000 stmicroelectronics - all rights reserved. purchase of i 2 c components by stmicroelectronics conveys a license under the philips i 2 c patent. rights to use these components in an i 2 c system is granted provided that the system conforms to the i 2 c standard specification as defined by philips. stmicroelectronics group of companies australia - brazil - china - finland - france - germany - hong kong - india - italy - japan - malaysia - malta - morocco - singapore - spain sweden - switzerland - united kingdom - u.s.a. http:// www.st.com


▲Up To Search▲   

 
Price & Availability of ST6208C

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X